|
html- <ul class="ranking1 nhovers">
- <li class="active">
- <i class="num num_1">1</i>
- <a href="/" class="imgBox" target="_blank"><img
- src="pic.png" alt=""></a>
- <h4><a href="/" target="_blank">标题标题标题标题标题</a></h4>
- <p><a href="/" target="_blank">下载</a></p>
- </li>
- <li class="">
- <i class="num num_1">2</i>
- <a href="/" class="imgBox" target="_blank"><img
- src="pic.png" alt=""></a>
- <h4><a href="/" target="_blank">标题标题标题标题</a></h4>
- <p><a href="/" target="_blank">下载</a></p>
- </li>
-
- </ul>
复制代码 css
- .ranking1 li .num{ font-style: normal; display: block; width: 20px; height: 20px; position: absolute; left: 0; top: 50%; margin-top: -10px; background-color: #cccccc; text-align: center; color: #fff;}
- .ranking1 li .num_1{ background-color: #e88000; }
- .ranking1 li{ position: relative; height: 20px; line-height: 20px; overflow: hidden; padding-left: 32px; border-bottom:1px dashed #f0f0f0;padding-top: 14px;padding-bottom: 14px;}
- .ranking1 li h4{ font-weight: normal; height: 20px; overflow: hidden;line-height: 20px; white-space: nowrap;text-overflow: ellipsis;font-size: 15px;}
- .ranking1 li .imgBox, .ranking1 li p{ display: none; }
- .ranking1 .active,.pageright .ranking1 .active{ height: 72px; overflow: hidden; }
- .ranking1 .active .imgBox,.pageright .ranking1 .active .imgBox{ display: block; width: 72px; height: 72px; float: left; margin-right: 16px;}
- .ranking1 .active .imgBox img{ display: block; width: 100%; height: 100%; border-radius: 10px;}
- .ranking1 .active h4{ height: 40px; line-height:20px; overflow: hidden; font-weight: normal;font-size: 16px;}
- .ranking1 .active p{ display: block;height: 30px;}
- .ranking1 .active .num{ }
- .ranking1 li .fr{color: #e08d27;font-size: 14px;padding-left: 4px;}
- .ranking1 .active .fr{display: none;}
- .ranking1 .active p a{ display: inline-block; width: 60px; height: 30px;line-height: 30px;text-align: center;background: #f27426;color: #fff; border-radius: 3px;}
复制代码
js
- $('.nhovers li').each(function(){
- $(this).mouseover(function(event) {
- $(this).addClass('active').siblings().removeClass('active');
- });
- });
复制代码
|
上一篇:Nginx配置伪静态404,Apache出现File not found.下一篇:关于jquery升级至3.5版本之后的兼容问题Uncaught TypeError: $(...).size is not a function
|