CSS -  CSS,  CSS, jQuery
 CSS  CSS
CSS » JavaScript » jQuery 3 -
 (-) 48 (+)
29-11-2009, 22:05 - GZ Design (JavaScript, jQuery)
 jQuery 3 -

, CSS. , jQuery. , ....

- 2 . HTML . index.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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>
CSS. jQuery #3.
</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="jquery.tools.min.js"></script>

- , :
<script type="text/javascript">
$(document).ready(function(){


$("ul.menu li a").mouseover(function() {

$(this).parent().find("ul.subnav").slideDown('fast').show();

$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow');
});
});
$("ul.menu li ul li a").mouseover(function() {

$(this).parent().find("ul.subnav2").slideDown('fast').show();

$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav2").slideUp('slow');

});

});
});
</script>

, "" ul menu.
$("ul.menu li a").mouseover(function() {

subnav,
$(this).parent().find("ul.subnav").slideDown('fast').show();

$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow');

3- subnav2. . "" , - (slide).

html , index.html:
</head>
<body>
<ul class="menu">
<li><a href="#"></a></li>
<li>
<a href="#"></a>
<ul class="subnav">
<li><a href="#">jQuery</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">PHP >></a>
<ul class="subnav2">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#">...</a></li>
</ul>
</li>
<li><a href="#">AJAX</a></li>
<li><a href="#">...</a></li>
</ul>
</li>
<li>
<a href="#"></a>
<ul class="subnav">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#">...</a></li>
</ul>
</li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li><a href="#"> </a></li>
</ul>
</body>
</html>

, jQuery CSS , index.html ( ). (style.css):
( ):
ul.menu {
list-style:none;
padding:0;
margin: 0;
font:12px Arial;
}

:
ul.menu li {
float: left;
margin: 0;
padding: 0;
position: relative;
}

ul.menu li a{
padding: 12px 15px;
padding-bottom:11px;
color: #fff;
display: block;
text-decoration: none;
float: left;
font-weight:bold;
border-left: 1px solid #10577e;
border-right: 1px solid #4582a4;
background:#246d96;
}
ul.menu li a:hover{
background:#2b76a0;
}

:
ul.menu li ul.subnav {
list-style: none;
position: absolute;
left: 0; top: 38px;
background:#246d96;
margin: 0; padding: 0;
display: none;
float: left;
width: 171px;
border: 1px solid #10577e;
z-index:1;
}

ul.menu li ul.subnav li{
margin: 0; padding: 0;
border-top: 1px solid #4582a4;
border-bottom: 1px solid #10577e;
clear: both;
width: 171px;
background:#246d96;
}
html ul.menu li ul.subnav li a {
float: left;
width: 130px;
border:0;
background:#246d96;
padding-top:7px;
padding-bottom:7px;
padding-left: 25px;
}
html ul.menu li ul.subnav li a:hover {
background:#2b76a0;
}

, :
ul.menu li ul.subnav2 {
list-style: none;
position: absolute;
left: 150px; top: -2px;
background:#246d96;
margin: 0; padding: 0;
display: none;
float: left;
width: 171px;
border: 1px solid #10577e;
z-index:10;
}

left top .

. . .
. !


: , CSS
: Internet Explorer 6 - 8; Mozilla Firefox 1.xx - 3.xx Opera 7. - 10.xx.


CSS! . . !



---------------------------------------
---------------------------------------

30500 () 8 .
   RSS

«     2017    »
 
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
 
2008-2017 Copyright, CSS. CSS-School.RU. .
Designed by GZ Design, OniX 2010 - 2017
Valid XHTML 1.0 Transitional  CSS!