Javascript event simulation library

后端 未结 4 1644
花落未央
花落未央 2020-12-21 23:04

Do you know a JS library for DOM events simulation? I know that this operation can be done but i can\'t find any library to do it.

UPDATE: I try to

相关标签:
4条回答
  • 2020-12-21 23:22

    Kangax made a very useful set of extensions for the PrototypeJS framework, the one that might interest you is Event.simulate

    0 讨论(0)
  • 2020-12-21 23:28

    http://developer.yahoo.com/yui/3/event/#eventsimulation

    """ Simulated events are browser-created events that, most of the time, behave exactly as user-initated events. Events bubble as they normally would and event objects are created with properties containing data about the event (sometimes these properties are browser-specific, so it's recommended that you make use of the browser-equalizing methods of Y.Event to retrieve the appropriate values for properties such as target, relatedTarget, and charCode. All event handlers are called synchronously at each event target throughout the event's lifetime. Events are simulated using the simulate() method on any Y.Node instance. """

    0 讨论(0)
  • 2020-12-21 23:32

    You can use prototype.js to fire your own custom events

    e.g. treeContainer.fire('nodeIcon:mousedown', {targetEvent: event, node: node});

    0 讨论(0)
  • 2020-12-21 23:35

    All of the major javascript libraries have the ability to trigger events. To add to the chorus of examples, in jquery you do it with: $("target_element").trigger("an_event");

    0 讨论(0)
提交回复
热议问题