DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery常見問題 >> jquery背景自動切換特效
jquery背景自動切換特效
編輯:JQuery常見問題     

查看效果網址:
http:///keleyi/phtml/jqplug/9.htm

本特效的jquery版本只支持1.9.0以下,例如不支持jquery1.10.2

代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jquery背景自動切換特效-</title>
<link rel="stylesheet" type="text/css" href="http:///keleyi/phtml/jqplug/9/main.css" />
<link rel="stylesheet" type="text/css" href="http:///keleyi/phtml/jqplug/9/bgstretcher.css" />
<script src="http:///keleyi/pmedia/jquery-1.8.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http:///keleyi/phtml/jqplug/9/bgstretcher.js"></script>
<script type="text/javascript">
$(document).ready(function(){

// Initialize Backgound Stretcher
$('BODY').bgStretcher({
images: ['http:///keleyi/phtml/jqplug/9/images/sample-1.jpg'
, 'http:///keleyi/phtml/jqplug/9/images/sample-2.jpg'
, 'http:///keleyi/phtml/jqplug/9/images/sample-3.jpg'
, 'http:///keleyi/phtml/jqplug/9/images/sample-4.jpg'
, 'http:///keleyi/phtml/jqplug/9/images/sample-5.jpg'
, 'http:///keleyi/phtml/jqplug/9/images/sample-6.jpg'],
imageWidth: 1024,
imageHeight: 768,
slideDirection: 'N',
slideShowSpeed: 1000,
transitionEffect: 'fade',
sequenceMode: 'normal',
buttonPrev: '#prev',
buttonNext: '#next',
pagination: '#nav',
anchoring: 'left center',
anchoringImg: 'left center'
});

});
</script>

<script type="text/javascript" src="http:///keleyi/phtml/jqplug/9/main.js"></script>

</head>
<body>
<div id="page" style="display: none_;">
<div class="page-top">&nbsp;</div>
<div class="page-content"><div class="page-wrapper">
<h1>背景圖片自動切換··Background Stretcher jQuery Plugin Demo</h1>

<form action="#"><div>
<div class="column">
<div class="row">
<h2>Transition Effect</h2>
<select id="effect">
<option value="none">None</option>
<option value="fade">Fade</option>
<option value="simpleSlide">Simple Slider</option>
<option value="superSlide">Super Slider</option>
</select>
</div>
<div class="row slide-directions">
<h2>Slide Direction</h2>
<div class="column small">
<div class="row"><input type="radio" id="dir-n" name="direction" class="direction" checked="checked"/><label for="dir-n">North</label></div>
<div class="row"><input type="radio" id="dir-s" name="direction" class="direction"/><label for="dir-s">South</label></div>
<div class="row"><input type="radio" id="dir-w" name="direction" class="direction"/><label for="dir-w">West</label></div>
<div class="row"><input type="radio" id="dir-e" name="direction" class="direction"/><label for="dir-e">East</label></div>
</div>
<div class="column small super-directions">
<div class="row"><input type="radio" id="dir-nw" name="direction" class="direction"/><label for="dir-nw">North-West</label></div>
<div class="row"><input type="radio" id="dir-ne" name="direction" class="direction"/><label for="dir-ne">North-East</label></div>
<div class="row"><input type="radio" id="dir-sw" name="direction" class="direction"/><label for="dir-sw">South-West</label></div>
<div class="row"><input type="radio" id="dir-se" name="direction" class="direction"/><label for="dir-se">South-East</label></div>
</div>
</div>
<div class="row">
<h2>Sequence Mode</h2>
<input type="radio" id="normal" name="mode" class="mode" checked="checked"/><label for="normal">Normal</label>
<input type="radio" id="back" name="mode" class="mode"/><label for="back">Back</label>
<span class="mode-randome"><input type="radio" id="random" name="mode" class="mode"/><label for="random">Random</label></span>
</div>
</div>
<div class="column">
<div class="row">
<h2>Manual Controls</h2>
<div class="nav-buttons">
<a href="javascript:;" id="prev">Previouse image</a>&nbsp;&nbsp;&nbsp;
<a href="javascript:;" id="next">Next image</a>
</div>
</div>
<div class="row nav-buttons">
<span class="pager">Pager:</span> <div id="nav">&nbsp;</div>
</div>
<div class="row">
<a href="javascript:;" id="toggleAnimation" >Pause Animation</a>
</div>
</div>
</div></form>
</div></div>
<div class="page-bottom">&nbsp;</div>
</div>
<div style="text-align:center;clear:both">

<br>
<p>適用浏覽器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. </p>
</div>

</body>
</html>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved