English 中文(简体)
Jquery循环粉碎时间out在被点击后加速吗?
原标题:Jquery cycle plugin timeout speeds up after click?

I am using the cycle plugin along with some other jquery script, I am also using the option to control the cycle plugin slides with an external nav, namely, <li> elements under ul#pan_ul.

一切似乎都是细致的,我有8 000人的时间,但在几次点击不同幻灯片后,周期排出频率似乎在增加,并且变得变幻。 一种幻灯似乎在2000年有时间,下一个5000,即1000。 仅在点击一些 n子之后,这种情况才会发生,然后将完全罚款。 我的守则是:

function cycleIt(){
$( #showcase ).cycle({ 
    fx:      scrollRight ,
    timeout: 8000,
    before:  onBefore,
    pager:   #pan_ul ,
        pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return  #pan_ul li:eq(  + idx +  ) ; 
        }
 });
}

function onBefore(){
    var currentPanel = $(this).index();
    var lastPanel = $(this).index()-1;
    if (lastPanel != -1) {
            $("#pan_ul li:eq("+currentPanel+")").css({"background-image":"url(Images/panelslice_ON.jpg)"})
            $("#pan_ul li:eq("+lastPanel+")").css({"background-image":"url(Images/panelslice.jpg)"});
                }
                else {
                $("#pan_ul li:first").css({"background-image":"url(Images/panelslice_ON.jpg)"})
                $("#pan_ul li:last").css({"background-image":"url(Images/panelslice.jpg)"});
                }           
}


$("#pan_ul li").click(function(){
    var oldPanel = $(".case:visible").index();
    var ind = $(this).index( #pan_ul li );

    $("#pan_ul li").css({"background-image":"url(Images/panelslice.jpg)"})
    $("#pan_ul li:eq("+ind+")").css({"background-image":"url(Images/panelslice_ON.jpg)"})
    /*$( #showcase ).cycle( stop );
return false;
    $(".case:eq("+oldPanel+")").hide();
    $(".case:eq("+ind+")").show();


*/
})
});

我已经上载了试验网站,如果你想亲自检查该网站的话,我正在网上生活。 这些行动每八次。 为了看到问题只是像一名马德曼那样在几秒的滚动导航的不同项目中点击。 然后观察滑坡的 time变。

http://attlefamousevents.com/TEST/

问题回答

我试图在幼.中复制,第二次抽出时间似乎发生变化,但随后又恢复正常。 因此,我怀疑,问题来源是点击中的一些泡沫事件。 如果在以下地点打电话,你可以阻止事件的发生和违约行为:

$.click(function(event){
event.preventDefault();
event.stopPropagation() ;
//rest of your code




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签