') document.getElementById('ooostyle').tell=o.id; } } if(!o.user_defined_stylesheet) return ''; return ''; } function make_style_make_menu(o, s){ if(s){ if(!o.id) {alert('a unique id is required for each menu');return;}; if(!o.menuItems||o.menuItems.constructor!=Array) {alert('an array of menu items is required for each menu');return;}; if(!o.menutop) {o.menutop=150}; if(!o.menuleft) {o.menuleft='50%'}; if(!o.keepinview&&typeof o.keepinview=='boolean') o.keepinview=false; else if(!o.keepinview) {o.keepinview=30}; if(!o.menuspeed) {o.menuspeed=20}; if(!o.menupause) {o.menupause=500}; if(!o.d_colspan) {o.d_colspan=2}; if(!o.allowtransparent) {o.allowtransparent=false}; if(!o.barwidth) {o.barwidth=22}; if(!o.hdingwidth) {o.hdingwidth=149}; if(!o.hdingheight) {o.hdingheight=22}; if(!o.hdingindent) {o.hdingindent=1}; if(!o.linkheight) {o.linkheight=16}; if(!o.outbrdwidth) {o.outbrdwidth=0}; if(!o.outbrdcolor) {o.outbrdcolor="none"}; if(!o.outbrdstyle) {o.outbrdstyle="none"}; if(!o.borderwidth) {o.borderwidth=1}; if(!o.bordercolor) {o.bordercolor="black"}; if(!o.borderstyle) {o.borderstyle="solid"}; if(!o.barcolor) {o.barcolor="white"}; if(!o.barbgcolor) {o.barbgcolor="#444444"}; if(!o.barfontweight) {o.barfontweight="bold"}; if(!o.baralign) {o.baralign="center"}; if(!o.menufont) {o.menufont="verdana"}; if(!o.fontsize) {o.fontsize="80%"}; if(!o.hdingcolor) {o.hdingcolor="white"}; if(!o.hdingbgcolor) {o.hdingbgcolor="#170088"}; if(!o.hdingfontweight) {o.hdingfontweight="bold"}; if(!o.hdingvalign) {o.hdingvalign="middle"}; if(!o.hdingtxtalign) {o.hdingtxtalign="left"}; if(!o.linktopad) {o.linktopad=0}; if(!o.linktxtalign) {o.linktxtalign="left"}; if(!o.linktarget) {o.linktarget=""}; if(!o.menupos) {o.menupos="left"}; if(!o.bartext) {o.bartext="SIDE MENU"}; if(!o.user_defined_stylesheet) {o.user_defined_stylesheet=false}; if(!o.user_defined_markup) {o.user_defined_markup=false}; if(!o.design_mode) {o.design_mode=false}; if(!o.wrapbar) {o.wrapbar=false}; if(!o.kviewtype) {o.kviewtype='absolute'}; if(typeof ie6_or_less!='undefined') o.kviewtype='absolute'; else if(o.menupos=='top'&&o.kviewtype=='absolute') o.kviewtype='fixed'; while(!o.menuItems[o.menuItems.length-1]) o.menuItems.length=o.menuItems.length-1; document.write(make_style(o)); return; } else { if(o.design_mode||!o.user_defined_markup){ var hw=o.hdingwidth; var tb='
\n'; tb+=o.menupos=='right'? make_bar(o) : ''; for (var i_tem = 0; i_tem < o.menuItems.length; i_tem++){ if ((o.menupos=='top'&&i_tem==0)||i_tem>0&&(!o.menuItems[i_tem-1][4]||o.menuItems[i_tem-1][4]!=='no')) tb+='' if (o.menuItems[i_tem][1]&&o.menuItems[i_tem][1]!==''){ tb+='' } else tb+='' if (!o.menuItems[i_tem][4]||o.menuItems[i_tem][4]!=='no') tb+=o.menupos=='left'&&i_tem==0? make_bar(o) : '\n'; } tb+=o.wrapbar&&o.menupos!='top'? '\n' : ''; tb+=o.menupos=='top'? make_bar(o) : ''; if(!o.user_defined_markup) document.write(tb+'
'+o.menuItems[i_tem][0]+''+o.menuItems[i_tem][0]+'
\u00a0
') } if(o.design_mode) document.getElementById('ooostyle').value+='\n\n\n\n'+tb+'
\n\n' o.m=document.getElementById(o.id); var b=document.getElementById(o.id+'bar'); o.m.b=b; o.m.ft=1; o.m.menupos=o.menupos; o.m.menupause=o.menupause; o.m.menuspeed=o.menuspeed; o.m.borderwidth=o.borderwidth; o.m.kviewtype=o.kviewtype; resizevent(o); if(o.menupos=='top'&&typeof window.attachEvent=='object'&&typeof ie6_or_less!='undefined') window.attachEvent('onscroll', function(){o.m.style.visibility='hidden';}); if(o.kviewtype=='absolute'&&(o.menupos!='top'||(typeof ie6_or_less!='undefined'&&typeof window.attachEvent=='object'))) setInterval(function(){keep_in_view(o)}, 20) } } function resizevent(o){ var m1=o.m.getElementsByTagName('div')[0], bo=o.menupos=='top'? o.m.b.offsetHeight : o.m.b.offsetWidth; m1.style[o.menupos]=bo-(o.menupos=='top'? m1.offsetHeight : m1.offsetWidth)+'px' if(o.menupos=='right'){ if(o.kviewtype=='absolute') o.m.style.left=getedge(o)-o.m.offsetWidth+'px'; o.m.style.width=bo+'px'; o.m.style.height=m1.offsetHeight+'px'; if(typeof less_than_ie5_5!='undefined'){ o.m.onmouseover(o.m); o.m.onmouseout(o.m); } } if(o.menupos=='top'){ o.m.style.width=m1.style.width=o.m.getElementsByTagName('table')[0].offsetWidth+'px'; if(typeof o.menuleft=='string') o.m.style.marginLeft=Math.floor(m1.offsetWidth/-2)+'px'; } } /* ONTEXTRESIZE EVENT SPOOFER Including this file in your page will allow you to assign a function to window.ontextresize, which will be called when the user changes the size of text on the page. Used with (as far as I know) permission from: http://forkandspoonhelmet.com/Fork_and_Spoon_Helmet */ var ontextresizeLastSize = false; if (window.attachEvent) window.attachEvent("onload", initOntextresizeListener); else if (window.addEventListener) window.addEventListener("load", initOntextresizeListener, false); function initOntextresizeListener() { if(!resizereinit||typeof less_than_ie5_5!='undefined') return; var testDiv = document.createElement("div"); testDiv.style.position = "absolute"; testDiv.style.height = "1em"; testDiv.style.width = "1em"; testDiv.style.top = "-2em"; testDiv.style.left = "-2em"; var docTestDiv = document.body.appendChild(testDiv); docTestDiv.id = "ontextresizeTestDiv"; ontextresizeListener = setInterval("ontextresizeCheckTestDiv()",100); } function ontextresizeCheckTestDiv() { if (ontextresizeLastSize!=document.getElementById("ontextresizeTestDiv").offsetWidth) { if (ontextresizeLastSize && window.ontextresize) window.ontextresize.call(); ontextresizeLastSize = document.getElementById("ontextresizeTestDiv").offsetWidth; } } window.ontextresize=function(){ for (var i_tem = 0; i_tem < menu.length; i_tem++) if(typeof menu[i_tem]!='undefined') resizevent(menu[i_tem]); }; function make_menus(){ if(document.getElementById){ for (var i_tem = 0; i_tem < menu.length; i_tem++) if(typeof menu[i_tem]!='undefined') make_style_make_menu(menu[i_tem], 's'); for (i_tem = 0; i_tem < menu.length; i_tem++) if(typeof menu[i_tem]!='undefined') make_style_make_menu(menu[i_tem]); } }
mmenu.js
Page URL
File URL
Prev  5/10  Next
Download ( 15 KB )
Leading Cloud Surveillance, recording and storage service. IP camera remote viewing, live streaming, broadcasting

Leading Enterprise Cloud IT Service. Cloud File Server, Drive Mapping, FTP Hosting, Online Storage

Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.

Comments
Total ratings: 0 Average rating: Not Rated

Would you like to comment?

Join DriveHQ for a free account, or Logon if you are already a member.