JS implementation of the Top Collapsible menu Toolbar Effect example

Source: Internet
Author: User
Tags relative

This article mainly introduced the JS implementation of the Top Collapsible menu toolbar effect, you can implement the mouse over the menu toolbar folding and expansion effect, involving JavaScript mouse events and style of operation skills, the need for friends can refer to the

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26-27--28 29---30 31--32 33 34 35 36 37 38-39 40 41 42 45, 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <title> can be collapsed menu toolbar </title> < Style> html,body{margin:0} body{URL (img.jpg) repeat-x;} ha{margin:0 Auto;} img{border:none;} #fx_topToolbar {P osition:relative;top:-76px;left:0; Margin:0 auto;height:92px; Background: #0C3E74; width:700px; Text-align:center; #fx_topToolbar. shell{margin:0 auto;padding:13px 0;} #btn_offOn {position:absolute;bottom:-8px; left:20px;height : 24px; width:150px; Background:url (img34.gif) no-repeat; #btn_offOn a{display:block;zoom:1;height:24px; position:relative;right:-16px background:url (tip.gif) no-repeat 100% 0; } </style> <script> (js={$:function (o) {return typeof o== ' string '? document.getElementById (o): O}, on: function (O,TYPE,FN) {o.attachevent?o.attachevent (' on ' +type,function () {Fn.call (O)}): O.addeventlistener (TYPE,FN, FALSE); RetuRN Js.on}, Move:function (WHO,ATTR,VAL,S,FN) {var fm=parseint (who.style[attr)) | | 0; Clearinterval (who[' Timer_ ' +attr]); var ifx= (function (form,to,s) {return function () {return form+=math[form<to? ' Ceil ': ' Floor '] ((to-form) * (s| | 0.3))}; }) (Fm,val,s); who[' timer_ ' +attr]=setinterval (function () {var v=ifx (); who.style[attr]=v+ ' px '; if (v==val) {Fn&&fn.call (who ); Clearinterval (who[' Timer_ ' +attr]); },18); }). On (window, ' Load ', function () {var q=js.$ (' Fx_toptoolbar '); q.style.top= ' -74px '; Js.on (js.$ (' Btn_offon '), ' mouseover ', function () {js.move (q, ' top ', 0)}) (q, ' mouseout ', function () {q.outtimer= settimeout (function () {js.move (q, ' top ', -74)},10)} (q, ' MouseOver ', function () {cleartimeout (This.outtimer)}); }) </script> </head> <body> <div id= "Fx_toptoolbar" > <div class= "Shell" > <a href= "#" Title= "" > <img src= "1.gif" width= "231" height= "alt=" "/> </a> <a href=" # "title=" "> <img src=" 2.gif "width=" 231 "height=" "alt=" "/> </a> </div> <div id= "Btn_offon" ><a href= "#" title= "" ></a></div> </div> </body> </html>

The

wants this article to help you with your JavaScript programming.

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.