Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

固定(滑動)圖層的固定位置能自己選擇座標嗎?

之前在別的網頁上可以看到有些類似廣告的東西,

一直黏在左下角(或右下角),

覺得很好玩,所以就用DW MX 的 Extension來作,

可是....它只能用左上、右上、左下和右下這些位置而已....

可以把它固定到我想要的座標嘛?

Update:

再補充一下....

他固定的標準可以以表格為相對位置的標準嗎?

1 Answer

Rating
  • 貴全
    Lv 4
    2 decades ago
    Favorite Answer

    <DIV id="waterMark" style="position:absolute">

    <A href="要連結的路徑"><IMG src="圖片路徑" border=0></A>

    </DIV>

    <script language="JavaScript1.2">

    <!--

    // Watermark script by Paul Anderson, CNET Builder.com. All rights reserved.

    markW = 80; // 寬度設定

    markH = 30; // 長度設定

    markX = 95; // 橫座標設定

    markY = 95; // 縱座標設定

    markRefresh = 20; //

    // set common object reference

    if (!document.all) document.all = document;

    if (!document.all.waterMark.style) document.all.waterMark.style = document.all.waterMark;

    wMark = document.all.waterMark.style;

    wMark.width = markW;

    wMark.height = markH;

    navDOM = window.innerHeight; // Nav DOM flag

    function setVals() {

    barW = 0; // scrollbar compensation for PC Nav

    barH = 0;

    if (navDOM) {

    if (document.height > innerHeight) barW = 20;

    if (document.width > innerWidth) barH = 20;

    } else {

    innerWidth = document.body.clientWidth;

    innerHeight = document.body.clientHeight;

    }

    posX = ((innerWidth - markW)-barW) * (markX/100);

    posY = ((innerHeight - markH)-barH) * (markY/100);

    }

    function wRefresh() {

    wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft);

    wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop);

    }

    function markMe() {

    setVals();

    window.onresize=setVals;

    markID = setInterval ("wRefresh()",markRefresh);

    }

    window.onload=markMe; // safety for Mac IE4.5

    //-->

    </script>

    Source(s): 自己(能改的地方都幫你標明了)
Still have questions? Get your answers by asking now.