要为父元素添加箭头,请执行以下操作:
jQuery + CSS Solution:
JQUERY:
jQuery(function($){
$(document).ready(function(){
$(\'ul.sub-menu\').parent().addClass(\'drop-down\'); // Add Sub-Menu Class to insert personalized style
$(\'li.drop-down > a:first-child\').wrapInner(\'<span class="menu-bullet" />\'); // Add .menu-bullet in span to insert your arrow image background
});
});
CSS:
div#nav ul li.drop-down a .menu-bullet {display:block; background:url(your_image_path.jpg) no-repeat; padding-left:15px; /* padding left value is based on arrow image width */}
要为子元素添加箭头,请执行以下操作:
jQuery + CSS solution:
JQUERY:
jQuery(function($){
$(document).ready(function(){
$(\'div#nav ul li ul li a\').wrapInner(\'<span class="arrow" />\');
});
});
CSS:
span.arrow {display:block; background:url(your_image_path.jpg) no-repeat; padding-left:15px; /* padding left value is based on arrow image width */}
or only CSS Solution:
div#nav ul li ul li a:before {content:"→ "}