• 用jQuery实现的一种网页内容呈现方式


     <!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=utf-8" />
    <title>一种网页内容呈现方式</title>
    <style>
    .box-now{cursor:pointer;background-color:#eee;}
    .qfbd{width:400px;height:auto;border:1px solid #333;}
    .box{height:34px;overflow:hidden;clear:both;border:1px solid #999;}
    .box .tit{height: 33px;line-height: 33px;text-align: left;border:1px solid #ccc;}
    .box .pt{}
    .box .pt:after{content:".";display:block;visibility:hidden;height:0px;clear:both;}
    </style>
    <script src="http://ajax.microsoft.com/ajax/jquery /jquery-1.4.min.js"></script>
    <script type="text/javascript">
    jQuery(function(jq){
        var cls = "box-now";
        var rd = jq('#sdyd-frag');
        var divs = rd.find('.box');
        var dur = 600,
        h = {min:34, max:193};
        
        divs.mouseover(function(el){
            el = jq(this);
            divs.not(el).removeClass(cls).stop().animate({'height':h.min},dur,'linear');
            
            el.stop().animate({'height':h.max},dur,'linear');
            el.addClass(cls);
        });
    
        divs.css({'height':h.min}).eq(0).css({'height':h.max});
        divs.eq(0).addClass(cls);
    });
    </script>
    </head>
    <body>
    <div id="sdyd-frag" class="qfbd">
    
        <div class="box">
            <div class="tit">标题一</div>
            <div class="pt">内容一</div>
        </div>
        <div class="box">
            <div class="tit">标题二</div>
            <div class="pt">内容二</div>
        </div>
        <div class="box">
            <div class="tit">标题三</div>
            <div class="pt">内容三</div>
        </div>
        <div class="box">
            <div class="tit">标题四</div>
            <div class="pt">内容四</div>
        </div>
        <div class="box">
            <div class="tit">标题五</div>
            <div class="pt">内容五</div>
        </div>
        <div class="box">
            <div class="tit">标题六</div>
            <div class="pt">内容六</div>
        </div>
    </div>
    </body>
    </html>
  • 相关阅读:
    Redis Info详解
    ABAP常用事务码
    ABAP区别CLEAR、REFRESH、FREE
    virtualbox安装增强功能时【未能加载虚拟光盘】
    https://www.safaribooksonline.com/home/
    图文教程教您蓝底照片更换成白底和红底的方法
    URAL1495. One-two, One-two 2(dp)
    URAL1513. Lemon Tale(dp)
    URAL1900 Brainwashing Device(dp)
    Codeforces Round #228 (Div. 1)B
  • 原文地址:https://www.cnblogs.com/cblx/p/3779543.html
Copyright © 2020-2023  润新知