This is a website navigation bar made in December 2003. I originally wanted to change to OOP and put it up. It seems that it is impossible to achieve this year, first publishing again. See the right picture, it consists of two scripts and HTML pages, the following is the detailed code, the demo can be downloaded from http://www.freewebs.com/kacarton/software/outlookbar.rar(7k): Script supports code Outlookbar. JS content: / * =============================================== =================================================200312-2004-3 Site: http://kacarton.yeah.net / Blog: http://blog.9cbs.net/nhconch email: kacarton@sohu.com
The article is the author original. Please contact him before reprinting, reprint, please indicate the article, retain the author information, thank you for your support! ============================================================================================================================================================================================================= ====================== * / var bar_open = false; var active_bar = null; var timer = null;
Function bar_click (obj) {var bar = document.getlementBYID ("first_bar"); if (bar == null || obj == null) return; bar = bar.nextsibling; while (bar) {if (bar.extend! = "Menubar") bar.style.display = "none"; bar = bar.nextsibling;} active_bar = obj; obj.nextsibling.style.display = 'block'; scrollbutton_moveto;}
function Item_Click (obj) {if (obj == null) return; mainfrm = document.getElementById ( "main"); mainfrm.src = obj.href;} function Item_MouseDown (obj) {obj.style.borderWidth = 1; obj .Style.BordertopColor = "# 666666"; obj.style.borderbottomcolor = "# fff"; obj.style.borderleftColor = "# 666666"; obj.style.BorderrightColor = "# fffffff";
Function item_mouseup (obj) {item_mouseover (obj);
function Item_MouseOver (obj) {if (obj == null) return; obj.style.borderWidth = 1; obj.style.borderTopColor = "# FFFFFF"; obj.style.borderBottomColor = "# 666666"; obj.style.borderLeftColor = "# Ffffff"; obj.style.BorderrightColor = "# 666666";
Function item_mouseout (obj) {if (obj == null) return; obj.style.Borderwidth = 0;}
function ScrollButton_MoveTo (obj) {var scroll_btn_up = document.getElementById ( "scroll_btn_up"); var scroll_btn_dn = document.getElementById ( "scroll_btn_dn"); if (obj == null || scroll_btn_up == null || scroll_btn_dn == null) return ; scroll_btn_up.style.pixelLeft = obj.offsetParent.offsetWidth-19; // scroll_btn_up.offsetWidth; scroll_btn_up.style.pixelTop = obj.offsetTop 25; // scroll_btn_up.offsetHeight 6; scroll_btn_dn.style.pixelLeft = obj.offsetParent .offsetWidth-19; // scroll_btn_up.offsetWidth; scroll_btn_dn.style.pixelTop = obj.offsetTop obj.offsetHeight; var client = obj.children [0] .children [0]; if (client.offsetHeight == client.children [0] .offsetHeight) {scroll_btn_up.style.display = "none"; scroll_btn_dn.style.display = "none";} else {if (client.scrollTop <= 0) scroll_btn_up.style.display = "none"; else Scroll_btn_up.style.display = "block"; if (Client.OffsetHeight Client.Scrolltop> = Client.children [0]. offsetHeight) scroll_btn_dn.style.display = "none"; else scroll_btn_dn.style.display = "block";}} function setScrollBtn () {if (active_bar) ScrollButton_MoveTo (active_bar.nextSibling);}
Function scrollStart (STEP) {if (active_bar == null) return; var obj = active_bar.nextsibling.children [0] .children [0]; if (obj == null) return; obj.scrolltop = step; if (Obj .scrollTop> 0 && obj.scrollTop obj.offsetHeight Function addbar (capen) {if (bar_open) Barend (); bar_open = true; document.write (" / n" td> / N " "
caption " td> / n" "
/ N " " TR> / n" "