English 中文(简体)
Detect 检测
原标题:jQuery Detect continual mousedown
  • 时间:2011-11-21 18:05:03
  •  标签:
  • jquery

是否有办法发现持续的 mo变? 换言之,我想继续发挥作用,而左 mo子正在受到压力。 这方面的例子就是想做的事情。 我有一顿子控制着雕塑的位置。 每次点击时,每点点击20例,但我希望在停用 but子时继续加固,停止使用。

类似于你离开潮 the时 on子的arrow子如何压倒

    var wrapperDiv = $("#wrapper-div");
    var scrollWidth = 0;

    $("#right-button").click(function() {
      if(scrollWidth < wrapperDiv[0].scrollWidth) {
        scrollWidth = scrollWidth+20;
        wrapperDiv.scrollLeft(scrollWidth);
      }

});
最佳回答
问题回答

如何使用、mouseup?

you should use a param for the event mousedown and mouseup

虽然降水是真实的,但你可以做到。 统计处的间隔期和你的事情。

如果是真的,你可以假定他不再点击 mo。

This is the same, but expanded into a player UI.
I found I needed to add the mouseleave to avoid non-detections.

var $wrapper = $( #main );

$( .pageBackOpt32 ).mousedown(scrollSlowL).mouseup(stopScroll).mouseleave(stopScroll);
$( .pageNextOpt32 ).mousedown(scrollSlowR).mouseup(stopScroll).mouseleave(stopScroll);
$( .pageRwOpt32 ).mousedown(scrollFastL).mouseup(stopScroll).mouseleave(stopScroll);        $( .pageFfOpt32 ).mousedown(scrollFastR).mouseup(stopScroll).mouseleave(stopScroll);

function scrollSlowL() { 
  $wrapper.animate({ scrollLeft:  -=50  }, scrollSlowL); 
}

function scrollSlowR() { 
  $wrapper.animate({ scrollLeft:  +=50  }, scrollSlowR); 
}

function scrollFastL() { 
  $wrapper.animate({ scrollLeft:  -=250  }, scrollFastL); 
}

function scrollFastR() { 
  $wrapper.animate({ scrollLeft:  +=250  }, scrollFastR); 
}

function stopScroll() {
  $wrapper.stop();
}




相关问题
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: &...

热门标签