我正在上有聯繫的左側和右側的內容區域的站點。我想獲得它進出使用jquery喜歡這個網站幻燈:http://www.templatemonster.com/demo/44960.html滑動的div導航
這是我當前的代碼(?能拿jFiddle工作)
<!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>Untitled Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
body {
/**background-image: url(../img/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
**/
background-color: red;
background-image: url(img/bg.jpg);
font-family:Arial, Helvetica, sans-serif;
height: 100%; margin: 0; width: 100%;
}
html,body { height:100%; }
#left {
position: relative;
margin: 0 5px 0 0;
overflow: hidden;
float: left;
width: 220px;
background-image: url(img/panel_bg.png);
background-repeat: repeat-y;
height: 100%;
}
#right {
position: relative;
float: left;
margin: 0 5px 0 0;
width: 630px;
height: 100%;
overflow: hidden;
}
div.panel {
position: absolute;
float: left;
height: 100%;
width: 620px;
margin-left: 10px;
background-image: url(img/content_bg.png);
background-repeat: repeat-y;
display: none;
}
</style>
<script type="text/Javascript">
jQuery(function($) {
$('a.panel').click(function() {
var $target = $($(this).attr('href')),
$other = $target.siblings('.active');
if (!$target.hasClass('active')) {
$other.each(function(index, self) {
var $this = $(this);
$this.removeClass('active').animate({
left: $this.width()
}, 500);
$($target).hide();
});
$target.addClass('active').show().css({
left: -($target.width())
}).animate({
left: 0
}, 500);
}
});
});
</script>
</head>
<body>
<div id="left">
<a href="#target1" class="panel">Target 1</a><br/>
<a href="#target2" class="panel">Target 2</a><br/>
<a href="#target3" class="panel">Target 3</a><br/>
</div>
<div id="right">
<div class="panel" id="target1">Target 1</div>
<div class="panel" id="target2">Target 2</div>
<div class="panel" id="target3">Target 3</div>
</div>
</body>
</html>
任何幫助,將不勝感激!
問題是什麼? –
我怎樣才能讓它像我鏈接到的網站?礦山只有滑過海誓山盟,並且不出來的權利,並從左側或VERS反之亦然 –
http://jsfiddle.net/T7LzN/這裏是你的代碼的jsfiddle。如果我弄清楚什麼,我會將其作爲答案發布。 –