功能需求:做一个有切换卡效果的信息列表,包含图片、信息标题,默认第一项显示图片和标题,其他只显示标题。当鼠标移动的时候,能够自动切换信息。下面是青青模板网整理的关于如何在帝国cms中实现鼠标切换信息调用的解决方案和思路,方便新手站长们在利用帝国cms建网站的时候,可以少走一些弯路。
将下面这段代码放到内容模板
本目录推荐
[e:loop={'selfinfo',9,2,1,0,0}] <li ><a href="https://www.ip3q.com/jiaocheng/" target="_blank">0<img src="https://www.ip3q.com/jiaocheng/" > [/e:loop]
$("#tab li").hover(function(){ var index=$(this).index(); $(this).parents().next().find(".tab-box").hide().eq(index).show(); $(this).addClass("tab-current").siblings().removeClass("tab-current"); });
CSS:
.a_bktj { padding: 20px; } .a_bktj li { overflow: hidden; border-bottom: 1px solid #f5f2f0; padding-bottom: 10px; margin-bottom: 10px; } .a_bktj li i { float: left; color: #aaa; font-family: arial; margin-right: 10px; padding-top: 13px; } .a_bktj li img { max-height: 80px; max-width: 80px; float: left; display: none; } .a_bktj li p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 10px; } .a_bktj li:hover img { display: block; } .a_bktj li:hover p { white-space: initial; } li.tab-current img {display: block;} li.tab-current p {white-space: initial;}
实现效果:
以上就是关于帝国cms使用教程中"帝国cms如何实现有切换选项卡的图书推荐列表?"的全部内容,如果有遇到帝国cms使用教程其他问题的,可以在评论留言,或者加微信咨询。
© 版权声明
THE END
暂无评论内容