• 网页标题上下滚动轮播代码


    /* CSS Document */
    ul,li,dl,ol{list-style:none;}
    
    .list_lh{ height:400px; overflow:hidden;}
    .list_lh li{ padding:10px;}
    .list_lh li.lieven{ background:#F0F2F3;}
    .list_lh li p{ height:24px; line-height:24px;}
    .list_lh li p a{ float:left;}
    .list_lh li p em{ width:80px; font:normal 12px/24px Arial; color:#FF3300; float:right; display:inline-block;}
    .list_lh li p span{ color:#999; float:right;}
    .list_lh li p a.btn_lh{ background:#28BD19; height:17px; line-height:17px; color:#fff; padding:0 5px; margin-top:4px; display:inline-block; float:right;}
    .btn_lh:hover{ color:#fff; text-decoration:none;}
    
    .btm p{ font:normal 12px/24px 'Microsoft YaHei'; text-align:center;}
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>jQuery文字无缝滚动效果代码 - 16素材网</title>
    <link type="text/css" href="css/style.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/scroll.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        $('.list_lh li:even').addClass('lieven');
    })
    $(function(){
        $("div.list_lh").myScroll({
            speed:40, //数值越大,速度越慢
            rowHeight:68 //li的高度 在css样式中li必须要有高度
        });
    });
    </script>
    </head>
    
    <body>
            <!-- 代码开始 -->
            <div class="list_lh">
                <ul>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">1000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">2000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">3000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">4000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">5000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">6000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">7000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">8000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">9000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">1000000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">1100000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                    <li>
                        <p><a href="http://www.16sucai.com/" target="_blank">1200000</a><a href="http://www.16sucai.com/" target="_blank" class="btn_lh">领号</a><em>获得</em></p>
                        <p><a href="http://www.16sucai.com/" target="_blank" class="a_blue">网游战江湖公测豪华礼包</a><span>17:28:05</span></p>
                    </li>
                </ul>
            </div>
            <!-- 代码结束 -->
       
    
    </body>
    </html>
    // JavaScript Document
    (function($){
        $.fn.myScroll = function(options){
        //默认配置
        var defaults = {
            speed:40,  //滚动速度,值越大速度越慢
            rowHeight:24 //每行的高度
        };
        
        var opts = $.extend({}, defaults, options),intId = [];
        
        function marquee(obj, step){
        
            obj.find("ul").animate({
                marginTop: '-=1'
            },0,function(){
                    var s = Math.abs(parseInt($(this).css("margin-top")));
                    if(s >= step){
                        $(this).find("li").slice(0, 1).appendTo($(this));
                        $(this).css("margin-top", 0);
                    }
                });
            }
            
            this.each(function(i){
                var sh = opts["rowHeight"],speed = opts["speed"],_this = $(this);
                intId[i] = setInterval(function(){
                    if(_this.find("ul").height()<=_this.height()){
                        clearInterval(intId[i]);
                    }else{
                        marquee(_this, sh);
                    }
                }, speed);
    
                _this.hover(function(){
                    clearInterval(intId[i]);
                },function(){
                    intId[i] = setInterval(function(){
                        if(_this.find("ul").height()<=_this.height()){
                            clearInterval(intId[i]);
                        }else{
                            marquee(_this, sh);
                        }
                    }, speed);
                });
            
            });
    
        }
    
    })(jQuery);

      

  • 相关阅读:
    无法直接启动带有类库输出类型的项目
    2个页面传值方法
    vs2005 无法附加 绑定句柄无效 解决办法
    认识serializable,序列化
    jsp 连接sql 2008
    有进步,嘎嘎....
    找不到存储过程'dbo.aspnet_CheckSchemaVersion'
    BackOffice Common中实现的相关功能
    MVC中Action相关方法的建议
    mysql的数据库相关维护操作:重启、修改连接数、删除连接
  • 原文地址:https://www.cnblogs.com/shark1100913/p/8670849.html
Copyright © 2020-2023  润新知