时间:2021-07-01 10:21:17 帮助过:28人阅读
具体代码如下:
css样式
/* CSS Document */ body { margin: 0 auto; padding: 0 auto; font-size: 9pt; font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif; } .accordion { padding-left: 0px; } .accordion li { border-top: 1px solid #000; list-style-type: none; } .titlemenu { width: 100%; height: 30px; background-color: #F2F2F2; padding: 5px 0px; text-align: left; cursor: pointer; } .titlemenu img { position: relative; left: 20px; top: 5px; } .titlemenu span { display: inline-block; position: relative; left: 40px; } .submenu { text-align: left; width: 100%; padding-left: 0px; } .submenu li { list-style-type: none; width: 100%; } .submenu li img { position: relative; left: 20px; top: 5px; } .submenu li a { position: relative; left: 40px; top: 5px; text-decoration: none; } .submenu li span { display: inline-block; height: 30px; padding: 5px 0px; } .hover { background-color: #4A5B79; }
自定义js
(function ($) { piano = function () { _menu ='[{"title":"一级目录","img":"images/cog.png","submenu":[{"title":"二级目录","img":"images/monitor_window_3d.png"},{"title":"二级目录","img":"images/monitor_window_3d.png"},{"title":"二级目录","img":"images/monitor_window_3d.png"}]},{"title":"一级目录","img":"images/cog.png","submenu":[{"title":"二级目录","img":"images/monitor_window_3d.png"},{"title":"二级目录","img":"images/monitor_window_3d.png"},{"id":"4","title":"二级目录","img":"images/monitor_window_3d.png"}]}]'; return ep = { init: function (obj) { _menu = eval('(' + _menu + ')'); var li =""; $.each(_menu, function (index, element) { li += '
html调用方式
无标题文档
希望本文所述对大家学习jquery程序设计有所帮助,对掌握手风琴特效更加熟练,文章下方有链接的相关文章,希望大家阅读学习。