Results 1 to 4 of 4

Thread: Floating Menu changes picture

  1. #1
    Join Date
    Feb 2007
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Floating Menu changes picture

    1) Script Title: Floating Menu Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...staticmenu.htm

    3) Describe problem:
    Hello, I have a question. I want to use the Floating Menu Script in my homepage. Anywhere in a different <div> there is a picture that I want to change while the menu is moving and change back if the menu stops.
    Is it possible to manage that? It would be great to get a solution on my problem.
    I'm sorry for not posting any link to my page; it is not written yet. Thank you very much. bye
    Immi

  2. #2
    Join Date
    Feb 2007
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Please help me. Anyone. I just want to know if it is possible not how.

  3. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <html>
    
    <head>
      <title></title>
    </head>
    
    <body>
    <div style="height:2000px;" ></div>
    <script>
    if (!document.layers)
    document.write('<div id="divStayTopLeft" style="position:absolute">')
    </script>
    
    <layer id="divStayTopLeft">
    
    <!--EDIT BELOW CODE TO YOUR OWN MENU-->
    <table border="1" width="130" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" bgcolor="#FFFFCC">
          <p align="center"><b><font size="4">Menu</font></b></td>
      </tr>
      <tr>
        <td width="100%" bgcolor="#FFFFFF">
          <p align="left"> <a href="http://www.dynamicdrive.com">Dynamic Drive</a><br>
           <a href="http://www.dynamicdrive.com/new.htm">What's New</a><br>
           <a href="http://www.dynamicdrive.com/hot.htm">What's Hot</a><br>
           <a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
           <a href="http://www.dynamicdrive.com/morezone/">More Zone</a></td>
      </tr>
      <tr>
        <td width="100%" bgcolor="#FFFFFF">
    <img id="tst" src="http://www.vicsjavascripts.org.uk/StdImages/One.gif" width="40" height="40" />
        </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="frombottom"
    
    if (!document.layers)
    document.write('</div>')
    
    function JSFX_FloatTopDiv()
    {
    	var startX = 3,
    	startY = 150;
    	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){
            document.getElementById('tst').src=startY==y?'http://www.vicsjavascripts.org.uk/StdImages/One.gif':'http://www.vicsjavascripts.org.uk/StdImages/Two.gif';
             this.style.left=x;
             this.style.top=y;
             startY=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.stayTopLeft=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("stayTopLeft()", 10);
    	}
    	ftlObj = ml("divStayTopLeft");
    	stayTopLeft();
    }
    JSFX_FloatTopDiv();
    </script></body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  4. #4
    Join Date
    Feb 2007
    Posts
    30
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much. It works very well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •