zoukankan      html  css  js  c++  java
  • 当当网首页——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();
    });
    

  • 相关阅读:
    mac 10.15.7 修改PATH
    oc 属性类型一般用法
    ubuntu解压zip文件名乱码
    telnet 退出
    docker 根据容器创建镜像
    mac android adb device 没有显示设备
    Yii2 查看所有的别名 alias
    Yii2 App Advanced 添加 .gitignore
    ubuntu 18.04 搜狗突然就提示乱码
    An error occured while deploying the file. This probably means that the app contains ARM native code and your Genymotion device cannot run ARM instructions. You should either build your native code to
  • 原文地址:https://www.cnblogs.com/a1111/p/6540398.html
Copyright © 2011-2022 走看看