Lid |
|
Beste,
Ik kan nu (eindelijk) mijn drop down menu's laten zien, echter wanneer ik op het menu zelf wil gaan staan met de muis verdwijnt deze. Dit komt uiteraard omdat mijn jQuery niet goed staat, hij kijkt namelijk naar de mouse-over van de links.
Zou iemand mij aub kunnen vertellen hoe ik dit wel kan fixen met een klein voorbeeld scriptie erbij misschien?
Mijn huidige code onderstaand:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Studiobizz | Audio & Recording</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/jquery-ui-1.8.16.custom.min.js"></script>
</head>
<body>
<div id="wrapper">
<div id="logo">
<img src="images/logo.png" alt="logo" />
</div>
<div id="opties">
<a href="/" title="opname studio Studiobizz">opname studio Studiobizz</a> -
<a href="route/" title="Route">Route</a> - <a href="faq/" title="FAQ">FAQ</a> -
<a href="sitemap/" title="Sitemap">Sitemap</a>
</div>
<div id="header">
<img src="images/header.png" alt="header" />
</div>
<div id="menu-wrapper">
<div id="menu">
<ul>
<li>Home</li>
<li><a href="#" title="Opname studio" id="opn-btn">Opname studio</a></li>
<li>Diensten</li>
<li>Muziekstijlen</li>
<li>Prijzen</li>
<li>Referenties</li>
<li class="last">Contact</li>
</ul>
</div>
<div id="opn-menu">
</div>
</div>
<div id="content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mi velit, placerat at placerat eu, cursus dapibus nisi. Sed at erat sed risus porttitor tempus. Phasellus imperdiet quam ac turpis vehicula scelerisque. In quis lectus massa, vitae suscipit lorem. Quisque leo sapien, consequat vitae vehicula et, aliquet sed nisl. Curabitur at turpis ut felis sollicitudin porta vitae quis urna. Phasellus volutpat porta venenatis. Sed hendrerit faucibus metus ac aliquam. Vestibulum dictum ornare lectus quis vehicula. Nullam venenatis quam sit amet velit sagittis sagittis. Etiam risus lorem, dictum at congue nec, dapibus non massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
</div>
<script language="javascript">
$(document).ready(function() {
$('#opn-btn').mouseover(function(){
$('#opn-menu').toggle();
})
$('#opn-btn').mouseout(function(){
$('#opn-menu').toggle();
})
});
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <img src="images/logo.png" alt="logo" /> <a href="/" title="opname studio Studiobizz">opname studio Studiobizz </a> - <a href="route/" title="Route">Route </a> - <a href="faq/" title="FAQ">FAQ </a> - <a href="sitemap/" title="Sitemap">Sitemap </a> <img src="images/header.png" alt="header" /> <li><a href="#" title="Opname studio" id="opn-btn">Opname studio </a></li> <li class="last">Contact </li> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent mi velit, placerat at placerat eu, cursus dapibus nisi. Sed at erat sed risus porttitor tempus. Phasellus imperdiet quam ac turpis vehicula scelerisque. In quis lectus massa, vitae suscipit lorem. Quisque leo sapien, consequat vitae vehicula et, aliquet sed nisl. Curabitur at turpis ut felis sollicitudin porta vitae quis urna. Phasellus volutpat porta venenatis. Sed hendrerit faucibus metus ac aliquam. Vestibulum dictum ornare lectus quis vehicula. Nullam venenatis quam sit amet velit sagittis sagittis. Etiam risus lorem, dictum at congue nec, dapibus non massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. <script language="javascript"> $(document).ready(function() { $('#opn-btn').mouseover(function(){ $('#opn-menu').toggle(); }) $('#opn-btn').mouseout(function(){ $('#opn-menu').toggle(); }) });
@charset "UTF-8";
/* CSS Document */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, vide, imgo {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
body {
font-family:Verdana;
font-size:12px;
color:#333;
}
#wrapper {
width:986px;
min-height:800px;
margin:25px auto;
overflow:hidden;
}
#logo {
width:207px;
height:60px;
float:left;
margin-left:98px;
}
#opties {
width:300px;
height:16px;
float:right;
margin:46px 32px 0px 0px;
}
#opties a, #opties a:visited {
color:#D2007A;
text-decoration:none;
}
#opties a:hover {
color:#750048;
}
#header {
width:986px;
height:289px;
float:left;
}
#menu-wrapper {
width:986px;
height:90px;
position:relative;
float:left;
text-align:center;
}
#menu-wrapper #menu {
width:986px;
height:90px;
position:relative;
top:0px;
left:0px;
background:url(../images/menu.png);
background-repeat:no-repeat;
z-index:9998;
}
#menu-wrapper #menu ul {
list-style:none;
}
#menu-wrapper #menu li {
display:inline-block;
font-size:18px;
color:#FFF;
margin-top:22px;
padding:0px 13px 0px 13px;
border-right:2px solid #FFF;
}
#menu-wrapper #menu li.last {
border:none;
}
#menu-wrapper #menu li a {
color:#FFFFFF;
text-decoration:none;
}
#content {
width:966px;
min-height:150px;
float:left;
margin-left:10px;
}
/* menu's */
#opn-menu {
min-width:180px;
height:300px;
background:#333333;
position:absolute;
top:25px;
left:155px;
border-bottom-left-radius:4px;
border-bottom-right-radius:4px;
-moz-border-radius-bottomleft:4px;
-moz-border-radius-bottomright:4px;
-webkit-border-bottom-left-radius:4px;
-webkit-border-bottom-right-radius:4px;
z-index:9997;
display:none;
}
@charset "UTF-8"; /* CSS Document */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, vide, imgo { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } body { font-family:Verdana; font-size:12px; color:#333; } #wrapper { width:986px; min-height:800px; margin:25px auto; overflow:hidden; } #logo { width:207px; height:60px; float:left; margin-left:98px; } #opties { width:300px; height:16px; float:right; margin:46px 32px 0px 0px; } #opties a, #opties a:visited { color:#D2007A; text-decoration:none; } #opties a:hover { color:#750048; } #header { width:986px; height:289px; float:left; } #menu-wrapper { width:986px; height:90px; position:relative; float:left; text-align:center; } #menu-wrapper #menu { width:986px; height:90px; position:relative; top:0px; left:0px; background:url(../images/menu.png); background-repeat:no-repeat; z-index:9998; } #menu-wrapper #menu ul { list-style:none; } #menu-wrapper #menu li { display:inline-block; font-size:18px; color:#FFF; margin-top:22px; padding:0px 13px 0px 13px; border-right:2px solid #FFF; } #menu-wrapper #menu li.last { border:none; } #menu-wrapper #menu li a { color:#FFFFFF; text-decoration:none; } #content { width:966px; min-height:150px; float:left; margin-left:10px; } /* menu's */ #opn-menu { min-width:180px; height:300px; background:#333333; position:absolute; top:25px; left:155px; border-bottom-left-radius:4px; border-bottom-right-radius:4px; -moz-border-radius-bottomleft:4px; -moz-border-radius-bottomright:4px; -webkit-border-bottom-left-radius:4px; -webkit-border-bottom-right-radius:4px; z-index:9997; display:none; }
EDIT: Had het ook zonder jQuery geprobeerd maar dan werkt er niks.
Ik heb een link met de id opn-btn, wanneer ik daar met mijn muis op staat veranderd er niks aan de div met het id opn-menu :S
#opn-menu {
min-width:180px;
height:300px;
background:#333333;
position:absolute;
top:25px;
left:155px;
border-bottom-left-radius:4px;
border-bottom-right-radius:4px;
-moz-border-radius-bottomleft:4px;
-moz-border-radius-bottomright:4px;
-webkit-border-bottom-left-radius:4px;
-webkit-border-bottom-right-radius:4px;
z-index:9997;
}
#opn-btn:hover #opn-menu {
background:#FF0000;
}
#opn-menu { min-width:180px; height:300px; background:#333333; position:absolute; top:25px; left:155px; border-bottom-left-radius:4px; border-bottom-right-radius:4px; -moz-border-radius-bottomleft:4px; -moz-border-radius-bottomright:4px; -webkit-border-bottom-left-radius:4px; -webkit-border-bottom-right-radius:4px; z-index:9997; } #opn-btn:hover #opn-menu { background:#FF0000; }
Idee staat hier: http://www.devbizz.nl/customers/studiobizz/
Verder heb ik als laatste ook dit geprobeerd:
<script language="javascript">
$('.menulijst').hide();
// functie voor hover maken
function showlist(argument)
{
$('.menulijst').hide();
$('#'+argument).show();
}
</script>
<script language="javascript"> $('.menulijst').hide(); // functie voor hover maken function showlist(argument) { $('.menulijst').hide(); $('#'+argument).show(); } </script>
Dit werkt prima, echter wanneer ik met mijn muis buiten het menu en -of de div komt blijft deze staan en ik weet niet hoe ik dit moet aanpakken ;)
|