The potential of JavaScript frameworks is unimaginable. The constant evolution of them; new functionality and features, takes web development to a whole new segment. I’m totally speechless by what developers are achieving with the implementation of special JavaScript effects and techniques.

The latest impressive effect I came by was the so called Link Nudge, and I remember the first time I read about it was at David Walsh corner. He posted both, the jQuery and MooTools version. See here and here. However, David talks about it assuming one already should have a necessary knowledge of working with JavaScript. Hence, it was a little confusing for me, since I’m particularly not a JavaScript developer.

Regardless of my inability to implement it in my sidebar links, it forced me to do some research about this effect and my searching results landed me into Trent Richardson’s Blog, where he discusses about this YoYo effect (that’s his brand for Link Nudge) and how to implement it.
I then realized that I wasn’t able to implement the David Walsh version because I couldn’t manage to add a class="nudge" to my Blogroll list (<li>) anchors (<a>). In addition to that I realized that everything should be hardcoded, meaning this does not apply to Sidebar Widgets. Maybe it does but requires a little further tweaking to be done.

Nevertheless, I modified my sidebar.php file and in the wp_list_bookmarks(); added before=&after= attributes,
then I had to tweak a bit YoYo effect’s speed so that it looks more smoother on action. Next thing was to include jQuery, put YoYo code to e seperate file, call them in my header.php so they get loaded with the page.


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type="text/javascript" src="files/yoyo-effect.js"></script>

It turned out that every step I took was correct, so there was nothing else but move the mouse up/down, left/right across friends links in the sidebar, while enjoying this little neat effect.

Hope you enjoyed it too. Seriously, it’s a nice tiny addition to a webpage.