html制作当当网首页的报告,当当网首页——JS代码

$(function($){

//打开一个广告窗口

window.open('open.html','','top=0,left=200,width=500,height=327,scrollbars=0,resizable=0');

//随滚动条滚动的可关闭广告窗口

$(window).scroll(function(){

var st = $(this).scrollTop()+50;

$("#right").css("top",st);

});

$("#right").find("a").click(function(){

$("#right").hide();

});

//轮换图片

function changeImg(){

var index=0;

var stop=false;

var $li=$("#content").find("#scroll_img").children("li");

var $page = $("#content").find("#scroll_number").children("li");

$page.eq(index).addClass("scroll_number_over").stop(true,true).siblings().removeClass("scroll_number_over");

$page.mouseover(function(){

stop=true;

index=$page.index($(this));

$li.eq(index).stop(true,true).fadeIn().siblings().fadeOut();

$(this).addClass("scroll_number_over").stop(true,true).siblings().removeClass("scroll_number_over");

}).mouseout(function(){

stop=false;

});

setInterval(function(){

if(stop) return;

index++;

if(index>=$li.length){

index=0;

}

$li.eq(index).stop(true,true).fadeIn().siblings().fadeOut();

$page.eq(index).addClass("scroll_number_over").stop(true,true).siblings().removeClass("scroll_number_over");

},3000);

}

changeImg();

//Tab切换

$("#bookTab").children(".book_new").find("[id]").mouseover(function(){

var id = "#book_"+$(this).attr("id");

$("#bookTab").children(".book_class").find("[id]").hide();

$(this).addClass("book_type_out").siblings().removeClass("book_type_out");

$(id).show();

});

//内容鼠标经过效果

$("#bookTab").children(".book_class").find("dd").mouseover(function(){

$(this).css("border","2px solid #F96");

}).mouseout(function(){

$(this).css("border","2px solid #fff");

});

//书讯快递循环垂直向上滚动

function movedome(){

var marginTop=0;

var stop=false;

var interval=setInterval(function(){

if(stop) return;

$("#express").children("li").first().animate({"margin-top":marginTop--},0,function(){

var $first=$(this);

if(!$first.is(":animated")){

if((-marginTop)>$first.height()){

$first.css({"margin-top":0}).appendTo($("#express"));

marginTop=0;

}

}

});

},50);

$("#express").mouseover(function(){

stop=true;

}).mouseout(function(){

stop=false;

});

}

movedome();

});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值