Expandable menus
$(document).ready(function(){ $('#menu > li > ul') .hide() .click(function(event){ event.stopPropagation(); }); $('#menu > li').toggle(function(){ $(this).find('ul').slideDown(); },function(){ $(this).find('ul').slideUp(); }); }); #menu { float: right; width: 200px; } #menu, #menu ul { list-style-type:…
scrolling gallery
$(document).ready(function(){ $('#pic_container').click(function(){ var numberOfPics=$(this).find('div > img').length; var next = Math.floor(Math.random()*numberOfPics); $(this) .scrollTo( '#pic_scroller>img:eq('+next+')',{duration:1000} ); }); }); /** * jQuery.ScrollTo * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com *…
thumbnail scroller
$(document).ready(function(){ $('#photos_inner').toggle(function(){ var scrollAmount = $(this).width()-$(this).parent().width(); $(this).animate({'left':'-='+scrollAmount},'slow'); },function(){ $(this).animate({'left':'0'},'slow'); }); }); #photos { overflow: hidden; width: 600px; } #photos_inner { height: 100px; width: 1500px; overflow: hidden; position: relative; } #photos_inner…
cycle สามารถทำ shuffle,zoom, fade,turnDown,curtainX,scrollRight
ไม่ support IE 6 $(document).ready(function(){ $('#photos').cycle({ fx:'shuffle' //เปลี่ยนได้ shuffle,zoom, fade,turnDown,curtainX,scrollRight }); }); /* * jQuery Cycle Plugin (with Transition Definitions) * Examples and documentation at: http://jquery.malsup.com/cycle/ * Copyright (c) 2007-2009…