After feeling under the weather for the past week and feeling incredibly bored, I decided to delve into the world of creating jQuery plugins. In just half an hour, I managed to put together a plugin that mimics the "wiggle" effect when pressing and holding down on a specific icon on an i(Phone|Pad|Pod Touch). Implementing the initial "wiggle" effect using CSS3 transitions was a breeze.
If you're curious to see the plugin in action, you can check it out here:
However, I hit a roadblock when trying to figure out how to make the icons stop wiggling. As someone new to creating jQuery plugins, I'm still trying to fully grasp how to save and manipulate the state of selected objects for future reference, such as through a callback or event.
To address this challenge, I resorted to creating an array to keep track of all the matched objects. This array serves as a way to maintain the state of objects with the wiggle effect applied.
Although my current solution technically works, it feels somewhat inefficient. I can't help but wonder if there's a more efficient, possibly built-in method within jQuery to achieve the same outcome.
If anyone could review this simple plugin and provide insights on how I can improve it, I would greatly appreciate it. I'm not looking for someone to rewrite my code, but rather some guidance through a real-world example or solid documentation.
Thank you in advance! :)
For those interested, here is the source code of the plugin: