I want to make div id='logo' clickable with jquery using .click function. Unfortunately logo id is completely covered by id=header. Is there a jquery way to isolate the logo div from header div?
<div i开发者_运维知识库d='header'>
<div id='logo'>
</div>
</div>
Ususally Drupal will link the logo to your front page, so this is likely not a jQuery issue, but a CSS one.
There are several things involving CSS: you could move the logo to some other place within the HTML structure:
$('#logo').appendTo('some selector')
You would then have to tell the #logo to visually go back to its position (for example set coordinates using CSS)
If, for some reason some other tag is on top of the logo, you might have success with the z-index property.
If you are thinking clicking on logo
div wil trigger the header
click event if there is any then you can stop the event propagation on logo
click. Try this
$("#logo").click(function(e){
//Do you stuff here
e.stopPropagation();
});
精彩评论