当前位置:编程学习 > JS >>

Expanding Image Menu jQuery点击图片可伸展的菜单

图文菜单,类似那种手风琴菜单,鼠标点击后显示出更详细的菜单,还有描述,加入了淡入淡出效果,可伸展的菜单,使用了两张大小相同的图片,一张彩色一张黑白,以配合效果的使用。
答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>Expanding Image Menu jQuery点击图片可伸展的菜单</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
</head>
    <style type="text/css">
	body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 
	margin:0;
	padding:0;
}
html,body {
	margin:0;
	padding:0;
	height:100%;
}
table {
	border-collapse:collapse;
	border-spacing:0;
}
fieldset,img { 
	border:0;
}
input{
	border:1px solid #b0b0b0;
	padding:3px 5px 4px;
	color:#979797;
	width:190px;
}
address,caption,cite,code,dfn,th,var {
	font-style:normal;
	font-weight:normal;
}
ol,ul {
	list-style:none;
}
caption,th {
	text-align:left;
}
h1,h2,h3,h4,h5,h6 {
	font-size:100%;
	font-weight:normal;
}
q:before,q:after {
	content:'';
}
abbr,acronym { border:0;
}
	body{
	font-family:"Trebuchet MS", sans-serif;
	font-size:14px;
	background:#333;
	color:#fff;
}
.header{
	text-align:center;
	width:100%;
	height:35px;
	clear:both;
	background:#000 url(/jscss/demoimg/201207/1339052708614.gif) repeat top left;
	margin-bottom:20px;
	border-bottom:7px solid #222;
	font-size:11px;
	line-height:35px;
	font-style:italic;
	text-shadow:1px 1px 1px #000;
}
.header a{
	color:#aaa;
	text-shadow:1px 1px 1px #000;
	padding-right:20px;
}
.header a:hover{
	color:#fff;
}
.container {
	position:relative; /* needed for footer positioning*/
	margin:0 auto; /* center, not in IE5 */
	width:940px;
	height:auto !important; /* real browsers */
	height:260px; /* IE6: treaded as min-height*/
	min-height:100%; /* real browsers */
}
.left{
	float:left;
	margin-left:10px;
}
.back{
	position:absolute;
	right:10px;
	top:0px;
}
.content > h1{
	font-size:40px;
	font-weight:normal;
	text-shadow:0px 0px 1px #fff;
	font-family: 'Raleway', arial, serif;
	border-bottom:1px dotted #444;
	padding:10px 20px;
}
.content > h3{
	font-size:24px;
	color:#aaa;
	font-weight:normal;
	padding:10px 20px;
	text-shadow:1px 1px 1px #000;
	font-family: 'Rock Salt', arial, serif;
}
h3 a{
	font-size:14px;
	padding-left:20px;
}
a{
	color:#777;
	text-decoration:none;
}
a:hover{
	color:#fff;
}
.content {
	margin:0 auto;
	padding:0px 0px 0px 0px; /* Footer Padding */
}
.footer {
	position:absolute;
	width:100%;
	height:50px;
	line-height:50px;
	bottom:0; /* stick to bottom */
	background:#f0f0f0;
	border-top:7px solid #222;
	text-align:center;
	text-shadow:1px 1px 1px #000;
	color:#fff;
	background:#000 url(/jscss/demoimg/201207/1339052730394.gif) repeat top left;
}
.footer a{
	color:#aaa;
	padding:0px 10px;
	text-shadow:1px 1px 1px #000;
}
.footer a:hover{
	color:#fff;
	text-shadow:0px 0px 1px #fff;
}
/* Menu style */
.ei_menu{
	background:#111;
	width:100%;
	overflow:hidden;
}
.ei_menu ul{
	height:260px;
	margin-left:5px;
	position:relative;
	display:block;
	width:940px;
}
.ei_menu ul li{
	float:left;
	width:128px;
	height:260px;
	position:relative;
	overflow:hidden;
	border-right:2px solid #111;
}
.ei_preview{
	width:128px;
	height:260px;
	cursor:pointer;
	position:absolute;
	top:0px;
	left:0px;
	background:transparent url(/jscss/demoimg/201207/1339048835751.jpg) no-repeat top left;
}
.ei_image{
	position:absolute;
	left:128px;
	top:0px;
	width:128px;
	height:260px;
	opacity:0.2;
 
 
 
	background:transparent url(/jscss/demoimg/201207/1339048814393.jpg) no-repeat top left;
}
.pos1 span{
	background-position:0px 0px;
}
.pos2 span{
	background-position:-128px 0px;
}
.pos3 span{
	background-position:-258px 0px;
}
.pos4 span{
	background-position:-386px 0px;
}
.pos5 span{
	background-position:-514px 0px;
}
 
.ei_descr{
	position:absolute;
	width:260px;
	height:260px;
	border-right:7px solid #f0f0f0;
	padding:5px;
	left:128px;
	top:0px;
	background:#fff;
}
.ei_descr h2{
	font-family: 'Rock Salt', arial, serif;
	font-size:20px;
	color:#333;
	padding:5px;
	text-shadow:0px 0px 1px #fff;
	background:#fff url(../images/stripe_light.gif) repeat top left;
}
.ei_descr h3{
	font-family: 微软雅黑;
	color:#fff;
	text-shadow:0px 0px 1px #000;
	font-style:normal;
	padding:5px;
	background:#333;
}
.ei_descr p{
	color:#000;
	padding:5px 5px 0px 5px;
	line-height:18px;
	font-size:11px;
	font-family: Arial;
	text-transform:uppercase;
}
 
/* For the index_3 demo */
ul.trigger_list{
	position:absolute;
	right:20px;
	top:145px;
}
ul.trigger_list li{
	float:left;
	line-height:53px;
	color:#ddd;
	font-style:italic;
}
ul.trigger_list li a{
	font-family: 'Rock Salt', arial, serif;
	display:block;
	background:#000;
	color:#ddd;
	line-height:35px;
	padding:5px 10px;
	margin:3px;
	border-radius:5px 5px 5px 5px;
	text-shadow:1px 1px 1px #000;
}
ul.trigger_list li a:hover{
	background:#222;
	color:#fff;
 
}
    </style>
    <body>
		<div class="container">
			
			<div class="content">
				
				<div id="ei_menu" class="ei_menu">
					<ul>
						<li>
							<a href="#" class="pos1">
								<span class="ei_preview"></span>
								<span class="ei_image"></span>
							</a>
							<div class="ei_descr">
								<h2>Ted </h2>
								<h3>泰德·莫斯比</h3>
								<p>
								    天生浪漫,富有浓郁的艺术气息,对诗词、文学、外语都有一定的认识和造诣。对朋友热心,有义气,会在关键时刻给予足够的支持和鼓励。但为人有点吹毛求疵,完美主义感重,遇到大事情喜欢过分思考而导致驻足不前。
								</p>
							</div>
						</li>
						<li>
							<a href="#" class="pos2">
								<span class="ei_preview"></span>
								<span class="ei_image"></span>
							</a>
							<div class="ei_descr">
								<h2>RobinMarshall </h2>
								<h3>马修·艾瑞克森</h3>
								<p>
								    人憨厚老实,感情专一。道德观强,爱抱不平。心地善良,热心助人,重朋友,和家人感情非常好。精通各类牌类、棋类游戏。生平理想是用毕生精力来当一名保护环境的律师。
								</p>
							</div>
 
						</li>
						<li>
							<a href="#" class="pos3">
								<span class="ei_preview"></span>
								<span class="ei_image"></span>
							</a>
							<div class="ei_descr">
								<h2>Lily</h2>
								<h3>莉莉·艾尔德琳</h3>
								<p>
								    聪明伶俐,温柔体贴,厨艺了得。有点小八卦,对衣服、手提包等有难以按捺的购买欲。是小团体其余4人的首要倾诉对象,经常为左右为难的朋友给予指引和支持,对小孩子、动物和老人都非常有爱心。
								</p>
							</div>
						</li>
						<li>
							<a href="#" class="pos4">
								<span class="ei_preview"></span>
								<span class="ei_image"></span>
							</a>
							<div class="ei_descr">
								<h2>Robin </h2>
								<h3>罗宾·什贝斯基</h3>
								<p>
								由于从小被父亲当男孩抚养成长,故性格有点刚烈好强,不服输。爱国主义感强,爱好稍暴力的体育运动,嗜枪如命。年青时是加拿大少年歌星,出过几支单曲和MV。成年后只身来纽约。把其事业摆在首位,为主播梦想拼搏多年。异性缘佳。
								</p>
								
							</div>
						</li>
						<li>
							<a href="#" class="pos5">
								<span class="ei_preview"></span>
								<span class="ei_image"></span>
							</a>
							<div class="ei_descr">
								<h2>Barney</h2>
								<h3>巴尼·斯丁森</h3>
								<p>
								    在单亲家庭长大,母亲一人独自抚养他和同母异父的黑人哥哥。大学时代深爱女友,

上一个:播放列表文字显示/隐藏,点击展开
下一个:仿flash的css3面包屑导航

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,