zoukankan      html  css  js  c++  java
  • CSS skills: 1) Navigate item's animation

    <style>
            .nav { border-right:1px solid #268eb7; }
            .nav li{overflow:hidden;height:55px;border-left:1px solid #268eb7;}
            .nav li.active a,.nav li.active small{top:-55px !important;}
            .nav li a{position:relative;display:block;padding:7px 0 0;height:55px;color:#fff;text-transform:uppercase;}
            .nav li a small{margin-top:-3px;color:#6aa3c2;}
            .nav li a.hover{background-color:#fff;color:#007aaa;}
            .nav li.hover small{color:#dadada;}
    </style>
    <div style="background-color: #0e90d2">
                <ul class="am-avg-lg-8 nav">
                    <li class="box am-text-center">
                        <a href="">首页<small class="am-block">Home</small></a>
                        <a href="" class="hover">首页<small class="am-block">Home</small></a>
                    </li>
                    <li class="box am-text-center">
                        <a href="http://kgdn.kangbeijia.cn/ppls">品牌连锁<small class="am-block">BRAND CHAIN</small></a>
                        <a href="http://kgdn.kangbeijia.cn/ppls" class="hover">品牌连锁<small class="am-block">BRAND CHAIN</small></a>
                    </li>
                    <li class="box am-text-center">
                        <a href="http://kgdn.kangbeijia.cn/zjtd" style="top: 0px;">专家团队<small class="am-block">Experts</small></a>
                        <a href="http://kgdn.kangbeijia.cn/zjtd" class="hover" style="top: 0px;">专家团队<small class="am-block">Experts</small></a>
                    </li>                                
                    <li class="box am-text-center">
                        <a href="http://kgdn.kangbeijia.cn/hxjs" style="top: 0px;">核心技术<small class="am-block">Technology</small></a>
                        <a href="http://kgdn.kangbeijia.cn/hxjs" class="hover" style="top: 0px;">核心技术<small class="am-block">Technology</small></a>
                    </li>                                
                    <li class="box am-text-center">
                        <a href="javascript:void(0)" style="top: 0px;">齿科项目<small class="am-block">DENTAL ITEMS</small></a>
                        <a href="javascript:void(0)" class="hover" style="top: 0px;">齿科项目<small class="am-block">DENTAL ITEMS</small></a>
                    </li>                                
                    <li class="box am-text-center">
                        <a href="http://kgdn.kangbeijia.cn/myal">美牙案例<small class="am-block">DENTAL CASE</small></a>
                        <a href="http://kgdn.kangbeijia.cn/myal" class="hover">美牙案例<small class="am-block">DENTAL CASE</small></a>
                    </li>                                
                    <li class="box am-text-center">
                        <a href="http://kgdn.kangbeijia.cn/shzr">社会责任<small class="am-block">Sociol duty</small></a>
                        <a href="http://kgdn.kangbeijia.cn/shzr" class="hover">社会责任<small class="am-block">Sociol duty</small></a>
                    </li>                                
                    <li class="box am-text-center diff">
                        <a href="javascript:void(0)" onclick="swtClick()" style="top: -0.551801899715483px;">在线咨询<small class="am-block">ASK ONLINE</small></a>
                        <a href="javascript:void(0)" onclick="swtClick()" class="hover" style="top: -0.551801899715483px;">在线咨询<small class="am-block">ASK ONLINE</small></a>
                    </li>
                </ul>
            </div>
    <script>
    //更改导航栏目动画代码
        $(function(){
                var index;
                var obj;
                $('.nav li').each(function(){
                    obj=$(this);
                    index=obj.index();
                    if(index==4){
                        obj.find('a').attr('href','javascript:void(0)');
                    }
                    var cloneLi=obj.find('a').clone().addClass('hover');
                    obj.append(cloneLi);
                });
                $('.nav li').hover(function(){
                    $(this).children().stop().animate({top:'-55px'},250);
                },function(){
                    var _this=$(this).children();
                    _this.stop().animate({top:'0'},250);
                });
            });
    </script>
  • 相关阅读:
    【算法18】重排数组元素使得所有的奇数位于所有偶数之前
    php函数ob_start()、ob_end_clean()、ob_get_contents()
    php代码调试
    判断文件存在是用file_exists 还是 is_file
    ubuntu屏幕截图工具:scrot,可截鼠标拖曳的矩形区域图形
    mysql常用的技巧
    用户角色权限设计
    解决ubuntu耳机和音箱同时发音
    SSH免密码登录
    IE, Firefox下,checkbox的钩钩一旦勾上,画面再刷新,钩钩还是勾上的解决方案
  • 原文地址:https://www.cnblogs.com/feika/p/4497682.html
Copyright © 2011-2022 走看看