zoukankan      html  css  js  c++  java
  • HTML锚点参考

    锚点参考

        <ul class="banner-pic">
            <li style="background: url(../Content/images/new_cert/recruit/banner_test.jpg) no-repeat center; height: 355px" title="了解招聘">
                <a href="javascript:;">@*火热资讯*@</a>
            </li>
            <li style="background: url(../Content/images/new_cert/recruit/banner_test.jpg) no-repeat center; height: 355px" title="网上申请">
                <a href="javascript:;">@*全程服务*@</a>
            </li>
            <li style="background: url(../Content/images/new_cert/recruit/banner_test.jpg) no-repeat center; height: 355px" title="笔试">
                <a href="javascript:;">@*真题资料*@</a>
            </li>
            <li style="background: url(../Content/images/new_cert/recruit/banner.png) no-repeat center; height: 355px" title="课程介绍">
                <a href="javascript:;">@*精品课程*@</a>
            </li>
        </ul>
    var aLi = null;
        $(function () {
            aLi = $(".tab").find("li");
            aLi.click(function () {
                if ($(this).index() == 0) {
                    removerClass();
                    aLi.addClass("one-active");
                    $(".content-box").find(".font").hide();
                    $(".content-box").find(".font").eq($(this).index()).show();
                } else if ($(this).index() == 1) {
                    removerClass();
                    aLi.addClass("two-active");
                    $(".content-box").find(".font").hide();
                    $(".content-box").find(".font").eq($(this).index()).show();
                } else if ($(this).index() == 2) {
                    removerClass();
                    aLi.addClass("three-active");
                    $(".content-box").find(".font").hide();
                    $(".content-box").find(".font").eq($(this).index()).show();
                } else if ($(this).index() == 3) {
                    removerClass();
                    aLi.addClass("four-active");
                    $(".content-box").find(".font").hide();
                    $(".content-box").find(".font").eq($(this).index()).show();
                } else if ($(this).index() == 4) {
                    removerClass();
                    aLi.addClass("five-active");
                    $(".content-box").find(".font").hide();
                    $(".content-box").find(".font").eq($(this).index()).show();
                }
    
            })
    
            //banner大图切换
            $(".banner").slide({
                titCell: ".num ul",
                mainCell: ".banner-pic",
                effect: "fold",
                autoPlay: true,
                delayTime: 700,
                autoPage: true
            });
    
            var aBannerLi = $(".banner-pic").find("li");
    
            aBannerLi.click(function () {
                if ($(this).get(0).title == "了解招聘") {
                    $("html,body").animate({ scrollTop: $(".s-news").offset().top }, 900);
                    aLi.eq(0).trigger("click");
                }
                if ($(this).get(0).title == "网上申请") {
                    $("html,body").animate({ scrollTop: $(".s-news").offset().top }, 900);
                    aLi.eq(1).trigger("click");
                }
                if ($(this).get(0).title == "笔试") {
                    $("html,body").animate({ scrollTop: $(".s-news").offset().top }, 900);
                    aLi.eq(2).trigger("click");
                }
                if ($(this).get(0).title == "课程介绍") {
                    $("html,body").animate({ scrollTop: $(".s-products").offset().top }, 900);
                }
            })
    
    
        });
  • 相关阅读:
    [Android实例] 同一Activity的实例被多次重复创建
    js 只能输入数字和小数点的文本框改进版
    DDMS文件权限设置
    form search 带参数 提交
    Jquery-UI dialog与ZeroClipboard 冲突问题的解决
    ZeroClipboard实现跨浏览器复制
    WebSocket使用80端口的方法
    Leetcode题目:First Bad Version
    Leetcode题目:Longest Common Prefix
    Leetcode题目:Counting Bits
  • 原文地址:https://www.cnblogs.com/eric-qin/p/4427987.html
Copyright © 2011-2022 走看看