Author Topic: Floating Menu script  (Read 145 times)

0 Members and 1 Guest are viewing this topic.

Offline Corps

  • Sr. Member
  • *
  • Posts: 274
  • Karma: +0/-0
    • View Profile
Floating Menu script
« on: November 25, 2008, 08:01:34 AM »
Copy and paste the code below to your web application to work.


Code: [Select]
<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="100%" cellspacing="0" cellpadding="0">
   <tr width="100%" bgcolor="#9D8D8F">
      <td>
            <p align="center"><font size="2">Techronnatib></font>
      </td>
   </tr>
<tr><td>  
<table border="0" cellspacing="0" cellpadding="2">
<tr width="100%">
   <td valign="bottom"><input type="button" value="Save" onclick="javascript:submitPage()"></td>
   <td valign="bottom"><input type="button" value="Edit" onclick="javascript:editPage(\'<Computed Value>\')"></td>
       <td valign="bottom"><input type="button" value="Close" onclick="javascript:window.close()"></td>
   <td></td>
       <!--<td valign="bottom"><input type="button" value="Print Preview" onclick="openURL(\'<Computed Value>\');"></td>-->
</tr>
</table>
</tr></td>      
</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 = 0,
   startY = 10;
   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;
      var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + 10 ;
      ftlObj.y += (pY - startY - ftlObj.y)/8;
      }
      ftlObj.sP(ftlObj.x, ftlObj.y);
      setTimeout("stayTopLeft()", 10);
   }
   ftlObj = ml("divStayTopLeft");
   stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
;


Note: All <Computed Value> values can be replaced by your own text.

Techronnati | where technology never sleeps

Floating Menu script
« on: November 25, 2008, 08:01:34 AM »

Mountain View

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
165 Views
Last post August 27, 2008, 01:56:15 AM
by h2obubbler
0 Replies
161 Views
Last post August 27, 2008, 05:53:27 AM
by rpmolecule
2 Replies
947 Views
Last post February 11, 2015, 05:18:18 AM
by MoneyRepublic

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.