superfish
Superfish - a jQuery menu plugin (Dropdown)
for Details please visit:
http://users.tpg.com.au/j_birch/plugins/superfish
Aufgabe
DropDown Menü: Wird nicht in allen Templates benötigt, Bootstrap bringt beispielsweise ein eigenes Dropdownmenü mit sich.
Quellcode
<head>
<script type="text/javascript" src="<?php echo $firstparturl;?>plugins/jquery/jquery-1.7.2.min.js"></script>
<!-- superfish ... -->
<link rel="stylesheet" type="text/css" href="<?php echo $firstparturl;?>plugins/superfish/css/superfish.css" media="screen">
<script type="text/javascript" src="<?php echo $firstparturl;?>plugins/superfish/js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php echo $firstparturl;?>plugins/superfish/js/superfish.js"></script>
<script type="text/javascript">
// initialise plugins
jQuery(function(){
jQuery('ul.sf-menu').superfish({
delay: 500, // one second delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'fast', // faster animation speed
autoArrows: true, // disable generation of arrow mark-up
dropShadows: false, // disable drop shadows
hoverClass: 'sfHover', // the class applied to hovered list items
pathClass: 'overideThisToUse', // the class you have applied to list items that lead to the current page
});
});
</script>
<style>
<?php $sfwidth="800";?>
ul.sf-menu li { width: <?php echo floor($sfwidth/(1+substr_count(buildmenu("1","1","1"),"<li")));?>px; margin-top: -1px; }
.sf-menu ul {width:<?php echo floor($sfwidth/(1+substr_count(buildmenu("1","1","1"),"<li")));?>px;}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {left:<?php echo floor($sfwidth/(1+substr_count(buildmenu("1","1","1"),"<li")));?>px;}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {left:<?php echo floor($sfwidth/(1+substr_count(buildmenu("1","1","1"),"<li")));?>px;}
.sf-menu li {
background: #ccc;filter:alpha(opacity=90);opacity: .9;-moz-opacity: .9;
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
background: url('<?php echo $firstparturl,$templatedir;?>superfish.png');
outline: 0;color:#fff;
}
.sf-menu{margin-top:20px;}
.sf-menu li li {
background: #ccc;
}
.sf-menu li li li {
background: #ddd;
}
.sf-menu a {
border: 0px;
</style>
<!-- ... superfish -->
</head>
<body>
<?php
echo buildmenuul("3");
?>
<body>