最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Simulate mouse down and move left - Stack Overflow

programmeradmin0浏览0评论

in order to simulate a play effect with a jquery panorama,

I'd like to simulate that the mouse is down on it and that is being moved to a left/right side

is that posible?

same way we can

$('#item').click();

can we do something similar to achieve it?

in order to simulate a play effect with a jquery panorama,

I'd like to simulate that the mouse is down on it and that is being moved to a left/right side

is that posible?

same way we can

$('#item').click();

can we do something similar to achieve it?

Share Improve this question asked Feb 9, 2012 at 9:33 Toni Michel CaubetToni Michel Caubet 20.2k58 gold badges217 silver badges388 bronze badges 2
  • If you are using jquery panaroma (or which ever plugin you use), it's better to figure out the event that is called when the 'mouse is down on it and that is being moved' and trigger that event directly. – rkw Commented Feb 9, 2012 at 9:43
  • @rkw how can i find out the event? – Toni Michel Caubet Commented Feb 9, 2012 at 10:02
Add a ment  | 

3 Answers 3

Reset to default 6

Check out:

  • https://developer.mozilla/en/DOM/document.createEvent
  • MouseEvent constructor
  • https://developer.mozilla/en/DOM/element.dispatchEvent

Are you looking for .mousedown() and .mouseup methods. They should behave the same way as .click()

Check this link http://api.jquery./mousedown/

Its something like

$('selector').mousedown(function{
      $("selector").mousemove(function(event) {
        var msg = "Handler for .mousemove() called at ";
        msg += event.pageX + ", " + event.pageY;
        $("#log").append("<div>" + msg + "</div>");
         });
    });
发布评论

评论列表(0)

  1. 暂无评论