發表文章

目前顯示的是 8月, 2017的文章

jQuery外掛-「SuperResize打造全螢幕背景」適用各瀏覽器

Supersized全螢背景外掛: 適用瀏覽器:IE7.0+、Chrome、Firefox、Safari、Opera 展示: http://ds.minwt.com.tw/file/sampleView/jQuery/superresizefullbackground/ Supersized 參數設定: startwidth: 640 //照片起始長度 startheight: 480 //照片起始寬度 vertical_center: 1 //垂直居中 1居中,0關閉 slideshow: 1 //自動輪播 1開,0關 navigation: 1 //播放控制鈕 1開,0關 transition: 1 //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left //轉場效果 pause_hover: 1 //滑入時停止輪播 1開,0關 slide_counter: 1 //顯示圖片筆數 1開,0關 slide_captions: 1 //圖片名稱 slide_interval: 3000 //轉場時間 Supersized 增加圖片: 加在 <div id="supersize">~</div> 之間即可,增加圖片img標籤中,可用title來設定圖片名稱。 完成後就可在各平台上運作了。

網頁間切換的淡出、淡入效果

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { $('body').css('display', 'none'); $('body').fadeIn(1000); //一開始淡入 $('a.link').click(function(event) { //點選 class 為 link 的 a 元件時觸發 event.preventDefault(); //取消事件預設動作 newLocation = this.href; $('body').fadeOut(1000, newpage); //點選後淡出 }); function newpage() { window.location = newLocation; } }); </script>