Making a transparent gradient pop-up menu

Source: Internet
Author: User
Menus | gradients | Transparent very beautiful a menu script, the code is not complex, with a transparent gradient to achieve the speed of the gradient adjustable.

Production method:
Add code to page <script language=javascript>
var intdelay=30; Set menu display speed, bigger and slower
var intinterval=5;
function Menuclick ()
{
if (layermenu.style.display== "")
{
Gradientclose ();
}
else{
layermenu.filters.alpha.opacity=0;
Layermenu.style.display= "";
Gradientshow ();
}
}

function Gradientshow ()
{
Layermenu.filters.alpha.opacity+=intinterval;
if (layermenu.filters.alpha.opacity<100) settimeout ("Gradientshow ()", intdelay);
}

function Gradientclose ()
{
Layermenu.filters.alpha.opacity-=intinterval;
if (layermenu.filters.alpha.opacity>0) {
SetTimeout ("Gradientclose ()", intdelay);
}
else {
Layermenu.style.display= "None";
}
}
</SCRIPT>
Code, var intdelay=30; For menu fade speed, the larger the number the slower.
Insert layer and set DIY Property code:
<div id=layermenu style= "Display:none; Z-index:1; Filter:alpha (opacity=0); Position:absolute; ">
At the hyperlink, add the code:
<a href= "#" Onclick=menuclick () > Click </A>
Transparent gradient pop-up menu of the effect of the production is done!

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.