Gambar mengikuti scroll

31 12 2008

Buka >> http://www.ilmuwebsite.com/img/Gambar-mengikuti-scroll.htm

ini cocok untuk pemasangan iklan di website

<html>
<head>

<body topmargin=”0″ bgcolor=”#000000″>
<script>
if (!document.layers)
document.write(‘<div id=”divStayTopright” style=”position:absolute”>’)
</script>
</head>

<body bgcolor=”#000000″>

<layer id=”divStayTopright”>
<!–EDIT BELOW CODE TO YOUR OWN MENU–>
<table border=”0″ width=”130″ cellspacing=”0″ cellpadding=”0″>
  <tr>
    <td><img src=”TN_psd0810.JPG” width=”171″ height=”158″></td>
  </tr>
</table>
<!–END OF EDIT–>
</layer>

<script type=”text/javascript”>
/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
//Enter “frombottom” or “fromtop”
var verticalpos=”fromtop”

if (!document.layers)
document.write(‘</div>’)

function JSFX_FloatTopDiv()
{
    var startX = 0,
    startY = 0;
    var ns = (navigator.appName.indexOf(“Netscape”) != -1);
    var d = document;
    function ml(id)
    {
        var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
        if(d.layers)el.style=el;
        el.sP=function(x,y){this.style.right=x;this.style.top=y;};
        el.x = startX;
        if (verticalpos==”fromtop”)
        el.y = startY;
        else{
   
    el.y = ns ? pageYOffset + innerHeight :
document.body.scrollTop + document.body.clientHeight;
        el.y -= startY;
        }
        return el;
    }
    window.stayTopright=function()
    {
        if (verticalpos==”fromtop”){
        var pY = ns ? pageYOffset : document.body.scrollTop;
        ftlObj.y += (pY + startY – ftlObj.y)/8;
        }
        else{
   
    var pY = ns ? pageYOffset + innerHeight :
document.body.scrollTop + document.body.clientHeight;
        ftlObj.y += (pY – startY – ftlObj.y)/8;
        }
        ftlObj.sP(ftlObj.x, ftlObj.y);
        setTimeout(“stayTopright()”, 10);
    }
    ftlObj = ml(“divStayTopright”);
    stayTopright();
}
JSFX_FloatTopDiv();
</script>

</body>
</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Gambar mengikuti scroll


Aksi

Information

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s




%d blogger menyukai ini: