JAVASCRIPT+CSS3 Implement dynamic button menu special effects _javascript Skills

Source: Internet
Author: User

A menu button Special effects case, simple to achieve the dynamic effect.

Nonsense not to say, directly to everyone paste code, code to write good, but also please give a lot of advice to heroes.

<div class= "Bar" id= "menubar" > <div class= "menu" id= "menu0" > </div> <div class= "menu" id= "menu1" &
Gt </div> <div class= "menu" id= "menu2" > </div> </div>. bar{width:px; height:px border:px Solid #cc
C
border-radius:%;
position:fixed;
TOP:PX;
RIGHT:PX;
Z-index:;
Cursor:pointer;
menu{width:px; height:px background-color: #ccc; position:absolute; transform:translated (-%,-%,); left:%;  Transition:all. S cubic-bezier (.,.,.,.) s} #menu {top:%;} #menu {top:%;} #menu {top:%;} window.onload = function () {var menubar = document.getElementById ("menubar"); var menu = document.getElementById ("menu"); var menu = Document.getel
Ementbyid ("menu");
var menu = document.getElementById ("menu");
var i =; Menubar.onclick = function () {i++; if (i% = =) {Menu.style.top = + "%"; Menu.style.display = "none"; menu.style.top =
+ "%";
Menu.style.transform = "translated (-%,-%,) rotate (deg)";
Menu.style.transform = "translated (-%,-%,) rotate (deg)"; } else {menu.style.transform = "translated (-%,-%,) rotate (deg)"; menu.style.transform = "translated (-%,-%,) rotate (deg)";
Menu.style.top = + "%";
Menu.style.top = + "%";
Menu.style.display = "block"; }
}
}

The above code simple implementation of the Dynamic button menu effects, I hope to help you.

Related Article

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.