Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    864
    Thanks
    51
    Thanked 6 Times in 5 Posts

    static slide out menu - require to be cross-browser

    1) Project Details:

    I have a page that I have stripped to the part which does not function in anything but i.e.

    The part which does not work is a static floating menu that expands when clicked.

    2) Payment Amount:

    I am willing to pay whatever is reasonable.

    3) Payment method/ details (Paypal, check? Timeline?):

    No timeline, but I can pay by PayPal.

    4) Additional Info (about project or potential bidders):

    Code:
    <html>
    
    <head>
    <title></title>
    <script>
    var ie = document.all ? 1 : 0
    var ns = document.layers ? 1 : 0
    var master = new Object("element")
    master.curLeft = 0;	master.curTop = 10;
    master.gapLeft = 0;	master.gapTop = 0;
    master.timer = null;
    
    function moveAlong(layerName, paceLeft, paceTop, fromLeft, fromTop){
    clearTimeout(eval(layerName).timer)
    
    if(eval(layerName).curLeft != fromLeft){
         if((Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft)) < paceLeft){eval(layerName).curLeft = fromLeft}
    else if(eval(layerName).curLeft < fromLeft){eval(layerName).curLeft = eval(layerName).curLeft + paceLeft}
    else if(eval(layerName).curLeft > fromLeft){eval(layerName).curLeft = eval(layerName).curLeft - paceLeft}
    if(ie){document.all[layerName].style.left = eval(layerName).curLeft}
    if(ns){document[layerName].left = eval(layerName).curLeft}
    }
    
    if(eval(layerName).curTop != fromTop){
         if((Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop)) < paceTop){eval(layerName).curTop = fromTop}
    else if(eval(layerName).curTop < fromTop){eval(layerName).curTop = eval(layerName).curTop + paceTop}
    else if(eval(layerName).curTop > fromTop){eval(layerName).curTop = eval(layerName).curTop - paceTop}
    if(ie){document.all[layerName].style.top = eval(layerName).curTop}
    if(ns){document[layerName].top = eval(layerName).curTop}
    }
    
    eval(layerName).timer=setTimeout('moveAlong("'+layerName+'",'+paceLeft+','+paceTop+','+fromLeft+','+fromTop+')',30)
    }
    
    function setPace(layerName, fromLeft, fromTop, motionSpeed){
    eval(layerName).gapLeft = (Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft))/motionSpeed
    eval(layerName).gapTop = (Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop))/motionSpeed
    
    moveAlong(layerName, eval(layerName).gapLeft, eval(layerName).gapTop, fromLeft, fromTop)
    }
    
    var expandState = 0
    
    function expand(){
    if(expandState == 0){setPace("master", 121, 10, 10);expandState = 1;}
    else{setPace("master", -120, 10, 10);expandState = 0;}
    }
    
    </script>
    </head>
    
    <body>
    
    <div id="master" style="position: absolute; left: -120px; top: 11px; width: 350px; height: 0px">
    	<div id="menu" style="position: absolute; left: 117px; top: 12px">
    		<table border="0" width="18" cellspacing="0" cellpadding="0">
    			<tr>
    				<td width="100%">
    				<a href="javascript:expand();" onfocus="this.blur()">
    				<img name="menutop" border="0" src="../../img/translate.gif" width="23" height="152"></a></td>
    			</tr>
    		</table>
    	</div>
    </div>
    <script type="text/javascript">
    if(ie){var sidemenu = document.all.master;}
    if(ns){var sidemenu = document.master;}
    function FixY(){
    screenWidth = screen.width;
    if (screenWidth == 1024){
    var yside = 390;
    }
    else if (screenWidth == 1152){
    var yside = 400;
    }
    else if (screenWidth == 1280){
    var yside = 400;
    }
    else{
    var yside = 500;
    }
    if(ie){sidemenu.style.top = document.body.scrollTop+yside}
    if(ns){sidemenu.top = window.pageYOffset+10}
    }
    setInterval("FixY()",100);
    </script>
    <div align="center">
    	<center>
    	<table border="1" cellpadding="10" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="1000">
    		<tr>
    			<td valign="top"><center>fixed slide out menu</center></td>
    		</tr>
    	</table>
    	</center></div>
    
    </body>
    
    </html>
    Thanks!
    Last edited by tpeck; 10-22-2010 at 03:15 PM.
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Did you want someone to update it (rewrite it) or just getting it working? The reason it only works in IE is because it is outdated and IE still understands document.all. I can do it for 15USD.
    Last edited by _Aerospace_Eng_; 10-22-2010 at 02:26 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    864
    Thanks
    51
    Thanked 6 Times in 5 Posts
    Thanks _Aerospace_Eng_ - it's yours.

    I would like it to be rewritten I think, if that makes it easier for you too, so that it functions in at least FF and Chrome.

    Is PayPal OK? I need your email right?
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)


  •  

    Posting Permissions

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