2013-02-19 18 views
0

我對jquery很新,我一直在試圖添加一個'剪輯'幻燈片放映效果到jquery的靜態位。如何將剪輯切換效果添加到jquery的靜態位

這是我後的效果......

http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=jquery_142

,這是我的代碼:

<!DOCTYPE html> 
<html> 
<head> 
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> 
    <style type="text/css"> 
    div { margin: 0px; width: 100%; height: 80px; background: green; position: relative; } 
</style> 

    <script> 
var divs = $('section div'), 
    links = $('a'); 

links.click(function(){ 
    $(this.hash).toggle().siblings().hide(); 
}); 

    </script> 

    <style> 

    section div { 
    display: none; 
    width:100%; 
    height: 200px; 
    background-color: lime; 
} 

nav a { 
    padding: 10px; 
    background-color: red; 
    color: white; 
    display: inline-block; 
} 
</style> 

</head> 
<body style="margin:0px;"> 

<section> 
    <div id="1"> 
     <a href="#1" style="float:right;">X</a> 
     <a href="#2">next &raquo;</a> 
    </div> 

    <div id="2"> 
     <a href="#2" style="float:right;">X</a> 
     <a href="#1">&laquo; prev</a> 
     <a href="#3">next &raquo;</a> 
    </div> 

    <div id="3"> 
     <a href="#3" style="float:right;">X</a> 
     <a href="#2">&laquo; prev</a> 
     <a href="#4">next &raquo;</a> 
    </div> 

    <div id="4"> 
     <a href="#4" style="float:right;">X</a> 
     <a href="#3">&laquo; prev</a> 
     <a href="#1">next &raquo;</a> 
    </div> 
</section> 

<nav> 
<a href="#1">one</a> 
<a href="#2">two</a> 
<a href="#3">three</a> 
<a href="#4">four</a> 
</nav> 

</body> 
</html> 

,你可以在這裏的行動看出來:

http://jsfiddle.net/greggb/8gfEZ/1/

任何幫助這個w應該很棒,我已經嘗試了很多論壇,但只是無法讓我的頭部輪到如何去做。

回答

相關問題