goTOP
August 25, 2012
點擊在新視窗中瀏覽此圖片


<script LANGUAGE="JavaScript">
<!--
  function openwin() {
  window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") file://写成一行

  }
//-->
</script>


window.open 談出新視窗的命令文;
'page.html' 弹出窗口的文件名;
'newwindow' 彈出窗口的名字(不是文件名),可空白' ';
height=100 窗口高度;
width=400 窗口寬度;
top=0 窗口距離瀏覽器上方的距離值;
left=0 窗口距離瀏覽器左側的距離值;
toolbar=no 是否顯示工具欄,yes為顯示;
menubar,scrollbars 表示清單與滾動軸。
resizable=no 是否可改變視窗大小,yes为允許;
location=no 是否显示地址栏,yes为允许;
status=no 是否顯示狀態欄內的訊息(指是視窗開啟時),yes為允許;

html+javascript的寫法:

<html>
<head>
<script LANGUAGE="JavaScript">
<!--
  function openwin() {
  window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //要寫成一行
  }
//-->
</script>
</head>
<body onload="openwin()">
任意的頁面內容...
</body>
</html>


開啟新增視窗方法有四種:

方法一:
<body  onload="openwin()"> 瀏覽器開啟時(讀取時)彈出視窗;

方法二:
<body  onunload="openwin()"> 瀏覽器離開頁面時(不讀取)彈出視窗;

方法三:用一个连接调用:
<a href="#" onClick="window.open('URL', 'Joseph', config='height=350,width=440')"/>開啟一個新視窗</a>
注意:必須使用“#”

方法四:用於發布按鈕時:
<input type="button" onclick="openwin()" value="開啟視窗">


August 19, 2012
點擊在新視窗中瀏覽此圖片

於head間置放:
<script type="text/javascript" src="{js}/jquery.js"></script>
<script type="text/javascript" src="{js}/ui.core.js"></script>
<script type="text/javascript" src="{js}/jquery.scroll-follow.js"></script>
<script type="text/javascript">
$( document ).ready( function (){
  $('#sideBar').scrollFollow({});
});

//option
$( document ).ready( function () {
  $( '#sideBar' ).scrollFollow( {
    speed: 2000,
    offset: 0,
    killSwitch: 'exampleLink',
    onText: 'Disable Follow',
    offText: 'Enable Follow'
  } );
} );
</script>


※speed: 2000,(速度)
※offset: 0,(top位置)

Requirements (必備零件)
    jQuery (tested with 1.2.6)
    jQuery UI Core (tested with 1.5.2)

Optional (追加零件)
    jQuery Easing Plugin
    jQuery Cookie Plugin

DEMO:
http://blog.apao.idv.tw/sample/ScrollFollow/index.html

出處:
http://kitchen.net-perspective.com/open-source/scroll-follow/
August 16, 2012
點擊在新視窗中瀏覽此圖片

使用CSS需要寫一大串將footer的部份固定在最下方,但jQuery提供了很方便的方式

使用方式如下:
1.下載並放置於伺服器的適當path
下載相關檔案
這個檔案只能在登入之後下載。請先 註冊登入


2.html head 中要加:
<script type="text/javascript" src="js/footerFixed.js"></script>


3.在html div的 footer部份中再寫入:
<div id=footer></div>


demo:
http://blog.apao.idv.tw/sample/footerFixed/





分頁: 1/1 第一頁 1 最後頁 [ 顯示模式: 摘要 | 清單 ]