I have a link I call using jquery. I call the CSS class and it is a simple toggle show/hide feature. Problem I have having is the toggle is working before the <a href>
is execute and not redirecting.
$(".second").click(function() {
$("#img_close").toggle();
});
The HTML:
<div id="img_close">
<a href="javascript:$.pageslide.close()" class="second"><img src="img/arrow.png"></a>
</div>
CSS:
#img_close { position:absolute; left:0px; display:none; top:50%; z-index:8888;}
.second
is not redirecting the javascript:$.pageslide.close()
because it toggles first, is there a way with jquery to fix this so it both executes the a href
and the toggle?
you could just put the two functions in the jquery function like this:
$(".second").click(function() {
$("#img_close").toggle();
$.pageslide.close();
});
or instead of using .click(function ());
you use .bind("click",function());
either or should work
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.