personnaliser menu avec jquery
Bonjour,
Pour mon premier site (je débute :D) je veux avoir un menu "dynamique" comme sur ce site:
http://www.footmercato.net/
J'ai réussi a faire une grande partie (95% grace a l'aide de quelques personnes) mais je bloque sur un détail et je ne trouve pas la solution étant donné que je ne connais pas trop jquery.
Je souhaite que:
-Lorsque la souris est sur le menu, le texte du menu soit en orange : ca c'est bon.
-Lorsque la souris passe ensuite sur l'une des cases du sous menu, le texte du menu et du sous menu soit en orange: ca aussi c'est bon
-Lorsque la souris est sur l'une des cases du menu et ensuite il va sur le block ul du sous menu (pas sur une case vu que ca, ca marche) le texte du menu soit en orange : et ca je n'arrive pas malheureusement.
Je vous serais très reconnaissant si vous pouviez m'aider.
mon html:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content=""/>
<meta http-equiv="lang" content="fr"/>
<meta name="revisit-after" content="15 days"/>
<meta name="robots" content="index, follow"/>
<meta name="Rating" content="General"/>
<meta name="Robots" content="All"/>
<link rel="shortcut icon" href=""/>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen,projection"/>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function() {
$(".menu li").hover(function() {
$(this).parents('li').first().children('a').first().css("color", "#FFBE00");
},function(){
$(this).parents('li').first().children('a').first().css("color", "black");
});
}
);
</script>
</head>
<body>
<div id="header">
<div class="head">
<div class="logo">
</div>
<div class="headright" >
<div class="connexion">
<img src="images/login.png" alt="" /><a href="#">Connexion</a>
<img src="images/register.png" alt="" class="decalage" /><a href="#">Inscription</a>
</div>
<div class="langage">
<a href="#"><img src="images/en.png" alt="English" title="English" /></a>
<a href="#"><img src="images/fr.png" alt="Français" title="Français" /></a>
<a href="#"><img src="images/es.gif" alt="Español" title="Español" /></a>
<a href="#"><img src="images/de.gif" alt="Deutsch" title="Deutsch" /></a>
<a href="#"><img src="images/it.PNG" alt="Italiano" title="Italiano" /></a>
<a href="#"><img src="images/cn.png" alt="中國的" title="中國的" /></a>
<a href="#"><img src="images/tr.jpg" alt="Türkce" title="Türkce" /></a>
</div>
</div>
</div>
<div class="menu" align="center">
<ul id="parent">
<li><a href="#">Accueil</a></li>
<li><a href="#">Chaine</a>
<ul id="fils">
<li><a href="#">Chaine 1</a></li>
<li><a href="#">Chaine 2</a></li>
<li><a href="#">Chaine 3</a></li>
</ul>
</li>
<li><a href="#">Programme</a></li>
<li><a href="#">Livesore</a></li>
<li><a href="#">VideoLig</a>
<ul id="fils">
<li><a href="#">Premier League</a></li>
<li><a href="#">Liga</a></li>
<li><a href="#">Serie A</a></li>
<li><a href="#">Bundesliga</a></li>
<li><a href="#">Ligue 1</a></li>
<li><a href="#">Superlig</a></li>
</ul>
</li>
<li><a href="#">Championnat</a>
<ul id="fils">
<li><a href="#">Premier League</a></li>
<li><a href="#">Liga</a></li>
<li><a href="#">Serie A</a></li>
<li><a href="#">Bundesliga</a></li>
<li><a href="#">Ligue 1</a></li>
<li><a href="#">Superlig</a></li>
</ul>
</li>
<li><a href="#">S'Abonner</a></li>
</ul>
</div>
</div>
<div id="main">
</div>
<div id="footer">
</div>
</body>
</html> |
mon css:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
/*######################### BODY #########################*/
body {
height: 100%;
width: 100%;
min-width: 1000px;
background: #ffffff;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
color:#000;
margin: auto;
}
img {
border: none;
}
a:link, a:visited, a:hover, a:active, a:focus {
outline:none !important;
}
/*######################### HEADER #######################*/
#header{
width: 100%;
}
#header .head{
height: 88px;
background-color: #A30503;
}
#header .menu {
background: url("../images/menu.png") repeat-x;
width: 100%;
position: relative;
height: 60px;
}
#header .menu ul {
margin: 0;
padding: 0;
list-style: none;
font-size: 0;
}
#header .menu li {
font-size: 16px;
display: inline-block;
text-transform: uppercase;
}
#header .menu a {
display: block;
text-align: center;
line-height: 30px;
height: 30px;
color: black;
text-decoration: none;
font-weight: bold;
padding: 0 18px 0 18px;
}
#header .menu * ul {
position: absolute;
left: -9999px;
bottom: 0;
background-color: transparent;
}
#header .menu a:hover {
background: #A30503;
color: #FFBE00;
}
#header .menu li:hover {
background: #A30503;
color: #FFBE00;
}
#header .menu li:hover ul{
left: 0;
margin: auto;
width: 100%;
}
#header .menu li * a {
color: #fff;
padding: 0 22px 0 22px;
}
#header .menu li * :hover {
background-color: transparent;
}
#header .headright{
background-color: #840503;
padding: 10px 10px 10px 20px;
width: 210px;
float: right;
}
#header .connexion{
padding-bottom: 10px;
}
#header .langage img{
margin: 0 2px 5px 0;
}
#header .connexion .decalage{
margin: 0 4px 0 6px;
}
#header .connexion img{
margin: 0 4px 0 0;
}
#header .connexion a{
vertical-align: top;
text-decoration: none;
font-size: 14px;
line-height: 34px;
font-weight: bold;
color: #fff;
}
#header .connexion a:hover{
color: #FFBE00;
} |