Js Vertical Telescopic Menu (Baidu) _ Navigation menu

Source: Internet
Author: User
<title> Vertical Telescopic menu from Baidu-www.jb51.net</title> <div class= "menu" id= "Menucontainer" > <p nodeid= " 390 "> Novice starter </p> <div id=" submenu_390 "> <p> about Baidu Search promotion </p> <p> account registration </p> <p> Quick Start </p> </div> <p nodeid= "397" > Promotional production </p> <div id= "submenu_397" > <p> set Match Way </ p> <p> Creative </p> <p> settings url</p> </div> <p nodeid= "436" > Promotion launch </p> <div Id= "submenu_436" > <p> click Filter </p> <p> quality </p> <p> keyword matching </p> <p> creative presentation Way </p > </div> <p nodeid= "506" > Effect evaluation </p> <div id= "submenu_506" > <p> promotion Effect </p> <p > Baidu bridge</p> </div> <p nodeid= "515" > Continuous optimization </p> <div id= "submenu_515" > <p> site Excellent </p> </div> <p nodeid= "520" > Value-added products </p> <div id= "submenu_520" > <p> Baidu Promotion Assistant &LT;/P&G T <p> Marketing Center </p> </div> <p class= "expand" nodeid= "3936" > Focus </p> <div id= "submenu_3936" > <p> Promotion topic </p> &L t;/div> </div> <script type= "Text/javascript" > var menu_id= "Menucontainer"; var menu_link_prefix= "./? Module=default&controller=index&action=node&nodeid= "; var sub_item_height=27;function G (A) {return document.getElementById (A)}var menuonshow;function initmenu () {try{if (window). Activexobject&&!window.isopera) {Document.execcommand ("Backgroundimagecache", False,true)}}catch (F) {}var C=g (menu_id). getElementsByTagName ("H4"); for (Var d=0,b=c.length;d<b;d++) {var e=c[d];if (e.classname!= ' current ') {e.onclick=menuclickhandler}if (e.classname== "expand") {var a=getmenucontainer (E); if (A.getelementsbytagname ("P"). length>0) {menuonshow=e; A.style.display= ""}}}}function Getmenucontainer (B) {var a=b.nextsibling;while (a.nodetype!=1) {A=A.nextSibling} Return a}function Menuclickhandler (I) {if (isontweening) {return}var d=getmenucontainer (this); var C=d.geteleMentsbytagname ("P"). Length;if (c<=0) {Top.location=menu_link_prefix+this.getattribute ("Nodeid"); return}if ( This!=menuonshow) {var b;var e=g (menu_id). getElementsByTagName ("H4"); for (Var f=0,a=e.length; f<a; f++) {var h=e[f];if (h.classname== "expand" &&getmenucontainer (H). getElementsByTagName ("P"). length>0) {B= H;break}}menuonshow=this;if (B) {queue.add (showsubmenu,this)}else{queue.add (showsubmenu,this)}}else{Queue.add ( Hidesubmenu,this); Menuonshow=null}queue.trigrun ()}function Showsubmenu (C) {var b=c.nextsibling;while (B.nodeType!= 1) {b=b.nextsibling}if (b.style.display!= "None") {return}var a=b.getelementsbytagname ("P"). Length;var d=a*sub_item_ HEIGHT; C.classname= "expand"; Tween (b,0,d)}function Hidesubmenu (B) {var a=b.nextsibling;while (a.nodetype!=1) {a= A.nextsibling}if (a.style.display== "None") {return}var c=a.offsetheight; B.classname= ""; Tween (a,c,0)}var queue={list:[],add:function (a,b) {Queue.list.push ({fn:a,tar:b})},trigrun: function () {var a=queue.list.shift (); if (A) {Ontweenfinished=queue.triGrun; A.fn (A.tar)}}};var Tweencurrentstep,tweenel,tweenbegin,tweenend,tweenoffset,tweeninterval;var tweenStep=5, Isontweening=0;var ontweenfinished;function Tween (c,b,a) {if (isontweening) {return}tweenel=c;tweenbegin=b;tweenend =a;tweenoffset=a-b;tweencurrentstep=0;tweenel.style.display= ""; tweenel.style.height=tweenbegin+ "px"; Isontweening=1;tweeninterval=setinterval (ontweenstep,10)}function ontweenstep () {tweencurrentstep++;if (tweenStep <=tweencurrentstep) {aftertween (); return}var A=math.floor (Tweenoffset*easeout (tweencurrentstep,tweenstep)); tweenel.style.height=tweenbegin+a+ "px"}function aftertween () {tweenel.style.height= ""; if (tweenend==0) { Tweenel.style.display= "None"}clearinterval (Tweeninterval); Tweeninterval=null;tweenel=null;isontweening=0;if ( ontweenfinished) {var a=ontweenfinished;ontweenfinished=null; A ()}}function easeout (a,b) {var c=a/b;return-c* (C-2)}initmenu (); </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.