Results 1 to 2 of 2

Thread: Combine Hovering script with CSS Menu

  1. #1
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Combine Hovering script with CSS Menu

    How would I be able to integrate this script

    http://www.dynamicdrive.com/dynamici...staticmenu.htm

    with this menu

    http://www.dynamicdrive.com/dynamici...enu-glossy.htm ?

    I currently have the menu in a set location, in a certain div on my page. And I would really like to implement the first mentioned script with this menu, so that it will scroll up and down with the page, and stay in this specific div where it is currently located.

    I tried putting the
    Code:
    <script>
    if (!document.layers)
    document.write('<div id="divStayTopLeft" style="position:absolute">')
    </script>
    
    <layer id="divStayTopLeft">
    above the glossy menu, and the

    Code:
    </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){this.style.left=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.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>
    below my current menu, but this appearantly does not work.

  2. #2
    Join Date
    Jul 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I found a solution to my own question...

    You can use

    Code:
    http://www.dynamicdrive.com/dynamicindex17/dockcontent.htm

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
  •