Js Vertical Scaling menu (Baidu) _ navigation menu

Source: Internet
Author: User
This menu has been removed from Baidu's promotion. The CSS file is removed, and only the core Js actions are retained. Click the title of each item to expand the level-2 subitem menu, if you want to add styles by yourself, you can better match the theme of your website.

<Title> vertical scaling menu from Baidu-www.jb51.net </title> <p class = "menu" id = "MenuContainer"> getting started <p style = "display: none "id =" submenu_390 "> <p> About Baidu search promotion </p> <p> account registration </p> <p> Quick Start </p>> promotion and production <p style = "display: none "id =" submenu_397 "> <p> set the matching method </p> <p> write idea </p> <p> set URL </p> advertising promotion <p style = "display: none "id =" submenu_436 "> <p> click filter </p> <p> Quality </p> <p> keyword match </p> <p> originality display method </p> Effect Evaluation <p style = "display: none "id =" subme Nu_506 "> <p> promotion effect </p> <p> Baidu Bridge </p> continuous optimization <p style =" display: none "id =" submenu_515 "> <p> website optimization </p> value-added products <p style =" display: none "id =" submenu_520 "> <p> Baidu promotion assistant </p> <p> marketing center </p> focus <p style =" display: none "id =" submenu_3936 "> <p> promotion topic </p> <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 &&! Specified parameter isopera00000000document.exe cCommand ("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 (. getElementsByTagName ("p "). length> 0) {menuOnshow = E;. style. display = "" }}} function getMenuContainer (B) {var A = B. nextSibling; while (. nodeType! = 1) {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; F0) {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 (. nodeType! = 1) {A =. nextSibling} if (. style. display = "none") {return} var C =. offsetHeight; B. className = ""; tween (A, C, 0)} var Queue = {list: [], add: function (A, B) {Queue. list. push ({fn: A, tar: B})}, trigRun: function () {var variable) }}; 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 select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.