Sunday, May 24, 2009

jQuery on my Home Page

For a while I thought of adding some animation to my home page and so finally I got to doing it with help of scrollable jQuery plugin from flowplayer.org. It is really easy compared with old reusable JavaScript components – standard indeed matters, plus great documentation on this particular plug-in made its integration very simple. Aside from some minor CSS work I had to add just a few lines of scripting code to make it all work:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="styles/jquery.scrollable-1.0.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function()
{
$("div.scrollable").scrollable({ size: 3 });
});

function moveNext()
{
$("div.scrollable").scrollable().next();
}

function movePrev()
{
$("div.scrollable").scrollable().prev();
}
</script>