N_3AZT [EP] Kawan
Number of posts : 156 Birthday : 1991-03-03 Age : 33 Registration date : 2009-03-09
| |
Mizie Administrator
Number of posts : 839 Birthday : 1990-05-09 Age : 33 Location : C:/WINDOWS/system32/autovirus.js Hobbies : explore our new things Affiliation : Wht do u want??? Registration date : 2009-03-06
| Subject: Re: floating menu.with toggle show hide. Fri Mar 20, 2009 12:32 pm | |
| | |
|
N_3AZT [EP] Kawan
Number of posts : 156 Birthday : 1991-03-03 Age : 33 Registration date : 2009-03-09
| |
Mizie Administrator
Number of posts : 839 Birthday : 1990-05-09 Age : 33 Location : C:/WINDOWS/system32/autovirus.js Hobbies : explore our new things Affiliation : Wht do u want??? Registration date : 2009-03-06
| Subject: Re: floating menu.with toggle show hide. Wed Mar 25, 2009 1:32 am | |
| - N_3AZT wrote:
- ak nda dpt bka kod nya
em cua ko kilik nih menu.js
pa yg ku ptt wt? spy ku dpt view kod nya.
ni kodnya.. klik spoiler ni.. - Spoiler:
var remember = false; //Remember menu states, and restore them on next visit. var contractall_default= true; //Should all submenus be contracted by default? (true or false)
var menu, titles, submenus, arrows, bypixels; var heights = new Array();
var n = navigator.userAgent; if(/Opera/.test(n)) bypixels = 2; else if(/Firefox/.test(n)) bypixels = 3; else if(/MSIE/.test(n)) bypixels = 2;
/////DD added expandall() and contractall() functions/////
function slash_expandall(){ if (typeof menu!="undefined"){ for(i=0; i<Math.max(titles.length, submenus.length); i++){ titles[i].className="title"; arrows[i].src = "http://www.geocities.com/profile_tester018/fLoatingmenuLinks/expanded.gif"; submenus[i].style.display=""; submenus[i].style.height = heights[i]+"px"; } } }
function slash_contractall(){ if (typeof menu!="undefined"){ for(i=0; i<Math.max(titles.length, submenus.length); i++){ titles[i].className="title"; arrows[i].src = "http://www.geocities.com/profile_tester018/fLoatingmenuLinks/collapsed.gif"; submenus[i].style.display="none"; submenus[i].style.height = 0; } } }
/////End DD added functions///////////////////////////////
function init(){ menu = getElementsByClassName("sdmenu", "div", document)[0]; titles = getElementsByClassName("title", "span", menu); submenus = getElementsByClassName("submenu", "div", menu); arrows = getElementsByClassName("arrow", "img", menu); for(i=0; i<Math.max(titles.length, submenus.length); i++) { titles[i].onclick = gomenu; arrows[i].onclick = gomenu; heights[i] = submenus[i].offsetHeight; submenus[i].style.height = submenus[i].offsetHeight+"px"; } if(remember) restore() else if (contractall_default) //DD added code slash_contractall() //DD added code }
function restore() { if(getcookie("menu") != null) { var hidden = getcookie("menu").split(","); for(var i in hidden) { titles[hidden[i]].className = "titlehidden"; submenus[hidden[i]].style.height = "0px"; submenus[hidden[i]].style.display = "none"; arrows[hidden[i]].src = "http://www.geocities.com/profile_tester018/fLoatingmenuLinks/collapsed.gif"; } } }
function gomenu(e) { if (!e) var e = window.event; var ce = (e.target) ? e.target : e.srcElement; var sm; for(var i in titles) { if(titles[i] == ce || arrows[i] == ce) sm = i; } if(parseInt(submenus[sm].style.height) > parseInt(heights[sm])-2) { hidemenu(sm); } else if(parseInt(submenus[sm].style.height) < 2) { titles[sm].className = "title"; showmenu(sm); } }
function hidemenu(sm) { var nr = submenus[sm].getElementsByTagName("a").length*bypixels; submenus[sm].style.height = (parseInt(submenus[sm].style.height)-nr)+"px"; var to = setTimeout("hidemenu("+sm+")", 30); if(parseInt(submenus[sm].style.height) <= nr) { clearTimeout(to); submenus[sm].style.display = "none"; submenus[sm].style.height = "0px"; arrows[sm].src = "http://www.geocities.com/profile_tester018/fLoatingmenuLinks/collapsed.gif"; titles[sm].className = "titlehidden"; } }
function showmenu(sm) { var nr = submenus[sm].getElementsByTagName("a").length*bypixels; submenus[sm].style.display = ""; submenus[sm].style.height = (parseInt(submenus[sm].style.height)+nr)+"px"; var to = setTimeout("showmenu("+sm+")", 30); if(parseInt(submenus[sm].style.height) > (parseInt(heights[sm])-nr)) { clearTimeout(to); submenus[sm].style.height = heights[sm]+"px"; arrows[sm].src = "http://www.geocities.com/profile_tester018/fLoatingmenuLinks/expanded.gif"; } }
function store() { var hidden = new Array(); for(var i in titles) { if(titles[i].className == "titlehidden") hidden.push(i); } putcookie("menu", hidden.join(","), 30); }
function getElementsByClassName(strClassName, strTagName, oElm){ var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName); var arrReturnElements = new Array(); strClassName = strClassName.replace(/\-/g, "\\-"); var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)"); var oElement; for(var i=0; i<arrElements.length; i++){ oElement = arrElements[i]; if(oRegExp.test(oElement.className)){ arrReturnElements.push(oElement); } } return (arrReturnElements) }
function putcookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document
| |
|
N_3AZT [EP] Kawan
Number of posts : 156 Birthday : 1991-03-03 Age : 33 Registration date : 2009-03-09
| |
Mizie Administrator
Number of posts : 839 Birthday : 1990-05-09 Age : 33 Location : C:/WINDOWS/system32/autovirus.js Hobbies : explore our new things Affiliation : Wht do u want??? Registration date : 2009-03-06
| Subject: Re: floating menu.with toggle show hide. Thu Mar 26, 2009 11:34 pm | |
| aik tnya aku lak..mn aku tau..ko kan yg jmpa fail ni..hehe..aku just tlng ko baca kan ni kod jak..hehehehe.d mn ko jmpa kod ni??? | |
|
N_3AZT [EP] Kawan
Number of posts : 156 Birthday : 1991-03-03 Age : 33 Registration date : 2009-03-09
| Subject: Re: floating menu.with toggle show hide. Fri Mar 27, 2009 11:07 am | |
| | |
|
Mizie Administrator
Number of posts : 839 Birthday : 1990-05-09 Age : 33 Location : C:/WINDOWS/system32/autovirus.js Hobbies : explore our new things Affiliation : Wht do u want??? Registration date : 2009-03-06
| Subject: Re: floating menu.with toggle show hide. Mon Mar 30, 2009 8:59 am | |
| | |
|
Sponsored content
| Subject: Re: floating menu.with toggle show hide. | |
| |
|