August 26th, 2010 by

My clients love when everything is moving upside down, from left to right and back.
This script implements nice effect so-called link nudging:

<script type='text/javascript'>
$(document).ready(function() {
	$('#sidebar .widget ul li a').hover(function() { //mouse in
		$(this).animate({ paddingLeft: '25px' }, 400);
	}, function() { //mouse out
		$(this).animate({ paddingLeft: '15px' }, 400);
	});
});
</script>

Of course, this script requires jQuery loaded previously.
Put this code between HEAD tags:

<script type="text/javascript" src="jquery.js"></script>

If you want to implement jQuery into WordPress CMS do it like this:

<?php wp_enqueue_script('jquery'); ?>

Leave a Reply