简体   繁体   中英

jQuery animate moves window

If the window's small enough (you have to scroll down to see the slider) and you click the grey button on the right of the images, the window jumps up to the top of the screen.

Why is that and how can I stop it?

http://jsfiddle.net/CUFjC/12/

This happens because the "button" is a link and when you click it, you will be redirected to "#". Try to replace the <a href="#" class="arrow left"> with <span class="arrow left"></span> or any other tag, but not a .

Change

$("div#wiseSlider a.arrow").bind('click', function(e){
    e.preventDefault();
    wiseSlider.shouldMove($(this));
});

http://jsfiddle.net/CUFjC/14/

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM