javascript - Simulate mouse down and move left - Stack Overflow

admin2025-03-20  3

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>");
         });
    });
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1742417155a212722.html

最新回复(0)