/* * jquery orbit plugin 1.1 * www.zurb.com/playground * copyright 2010, zurb * free to use under the mit license. * http://www.opensource.org/licenses/mit-license.php */ $(document).ready(function(){ var tabs = $(".tabs li"); var show = $("#show .contents"); var width = $(".keyimg img").width(); var height = $(".keyimg img").height(); var time,index=0; show.eq(0).find(".keyimg img").css({'margin-left':-width/2,'left':'50%','margin-top':-height/2,'top':'60%'}); tabs.mouseover(function(){ index = $(this).index(); clearinterval(time); tab(index); }); tabs.mouseout(function(){ start(); }); start(); function start(){ time = setinterval(function(){ tab(index); index++; if(index>=tabs.length){ index = 0; } },3000); } function tab(shownum){ var showimg = show.eq(shownum).find(".keyimg img"); var imgwidth = showimg.width(); var imgheight = showimg.height(); if(show.eq(shownum).css('display')=='block') return; showimg.css({'margin-left':-imgwidth/2,'left':'50%','margin-top':-imgheight/2,'top':'60%'}); show.hide(); show.eq(shownum).fadein(700); tabs.removeclass("current"); tabs.eq(shownum).addclass("current"); } }); $(document).ready(function(){ var tabs = $(".tabs01 li"); var show = $("#show01 .contents"); var time,index=0; tabs.mouseover(function(){ index = $(this).index(); clearinterval(time); tab(index); }); tabs.mouseout(function(){ start(); }); start(); function start(){ time = setinterval(function(){ tab(index); index++; if(index>=tabs.length){ index = 0; } },3000); } function tab(shownum){ if(show.eq(shownum).css('display')=='block') return; show.hide(); show.eq(shownum).fadein(); tabs.removeclass("current"); tabs.eq(shownum).addclass("current"); } });