adobe-webplatform / Snap.svg

The JavaScript library for modern SVG graphics.
http://snapsvg.io
Apache License 2.0
13.9k stars 1.14k forks source link

Binding events #137

Open jtojnar opened 10 years ago

jtojnar commented 10 years ago

It looks like there are currently no equivalent methods to on and off methods of jQuery. Some of the most common methods like click are generated in mouse.js but for example dragstart has no such method. Adding a generic event management method would fix this problem. Also some methods for triggering events wouldn't be so bad.

seancatkinson commented 10 years ago

+1

alexlime commented 9 years ago

+1 How to trigger a click event manually? Stuck on a simple task...

ibrierley commented 9 years ago

Could you clarify a bit (maybe with a fiddle example?). Ie if you could use undrag()...

For the manual event, I'm wondering if a plugin like this would help...

http://stackoverflow.com/questions/12059592/triggering-raphael-events-externally or I answered another question here http://stackoverflow.com/questions/22788635/manually-trigger-a-drag-event-in-snap-svg/22811062#22811062 that may have some use ?

If it does help, maybe we could write a more generic plugin that does the bits we need.

alexlime commented 9 years ago

It just worked for me ok... Thanks

  allPaths[35].events[2].f.call(allPaths[35]);