DIV CSS 佈局教程網

jQuery bgStretcher.js 實現全螢幕背景切換
編輯:JavaScript綜合知識     

插件特色

bgStretcher.js 是一款 jQuery 背景插件,可讓網頁背景自動切換多張圖片,並依視窗大小縮放。它支援淡入淡出、捲動與幻燈式切換,也能設定播放順序與方向。

初始化範例

$('.demoo').bgStretcher({
  images: [
    'images/sample-1.jpg',
    'images/sample-2.jpg',
    'images/sample-3.jpg'
  ],
  imageWidth: 800,
  imageHeight: 400,
  slideDirection: 'N',
  slideShowSpeed: 1000,
  transitionEffect: 'fade',
  sequenceMode: 'normal'
});

常用選項

  • images:背景圖片清單。
  • imageWidth / imageHeight:圖片原始尺寸。
  • transitionEffect:切換效果,可為 fade、simpleSlide、superSlide 等。
  • slideDirection:切換方向,例如 N、S、E、W。
  • sequenceMode:播放順序,可為 normal、back、random。
  • slideShow:是否啟用自動播放。

此插件也可用於特定區塊背景,不一定只用於整個頁面。

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