CSS,jQuery坡度/倾斜菜单
我在想我怎样才能达到这样的效果: 向左展开的“坡度”菜单CSS,jQuery坡度/倾斜菜单,jquery,css,menu,Jquery,Css,Menu,我在想我怎样才能达到这样的效果: 向左展开的“坡度”菜单 这可能吗?如果这应该像一个常规的下拉列表,唯一的区别是菜单项不在线,那么这是可能的。您可以使用普通菜单并使用jquery来移动位置或填充。这将是一个解决方案: $('ul.menu li').each(function() { var marginLeft = 0; // start margin left position in pixels var stapLeft = 50; // pixels // l
这可能吗?如果这应该像一个常规的下拉列表,唯一的区别是菜单项不在线,那么这是可能的。您可以使用普通菜单并使用jquery来移动位置或填充。这将是一个解决方案:
$('ul.menu li').each(function() {
var marginLeft = 0; // start margin left position in pixels
var stapLeft = 50; // pixels
// looping through every li item underneave a ul in the list
$(this).find('ul li').each(function() {
// set the margin for the element
$(this).css(marginLeft, marginLeft);
// set for the next item the margin
marginLeft += stapLeft;
});
});
但是有一个更好的方法来做这件事:)它只是给你指出一个方向