我正在使用此模板Simple Sidebar
我想在此模板SB Admin 2
中添加二级菜单我尝试使用带有自举的手风琴,但它看起来并不好
var canvas = document.createElement('canvas');
canvas.width = 100;
canvas.height = 20;
var canvasContext = canvas.getContext('2d');
document.body.appendChild(canvas)
var rafId;
function drawLoop(time) {
canvas.width = canvas.width;
canvasContext.fillRect(0, 0, Math.random() * 100 * 1.4, 20);
rafID = window.requestAnimationFrame(drawLoop);
}
drawLoop();
你有什么建议吗?
答案 0 :(得分:1)
只需使用jQuery :) ...将第二个菜单设置为display: none;
并调用向下滑动的函数.on('click')
$('.link-with-submenu').on('click', function(e){
e.preventDefault();
$(this).next('.collapse').slideDown();
});