[javascript]代码库
<script type="text/javascript">
var i=0;
var width=340;
function qu(){
var tmp=width*i;
$('li.cur').removeClass('cur');
$('.num li').eq(i).addClass('cur');
$('.lun1').animate({left:'-'+tmp+'px'},"slow");
if(i<3)
{
i++;
}
else
{
i=0;
}
setTimeout('qu()',2000);
}
</script>
<script type="text/javascript">
qu();
</script>
<script type="text/javascript">
var width=340;
$('.num li').mouseover(function(){
var i= $(this).index();
var tmp=width*i;
//console.log(tmp);
$('li.cur').removeClass('cur');
$('.num li').eq(i).addClass('cur');
$('.lun1').animate({left:'-'+tmp+'px'},"slow");
//console.log( $i);
});
</script>