


JS implements the console menu effect of Taobao Alipay website_javascript skills
The example in this article describes the JS implementation of the console menu effect of the Taobao Alipay website. Share it with everyone for your reference. The details are as follows:
This is a console main menu in the Alipay website, which can realize the display of animation effects. It is beautiful, simple and practical. When the mouse is moved over the text, a menu layer will slide out and disappear after being moved away. It is also the most popular one currently. A popular menu method that many friends like.
The screenshot of the running effect is as follows:
The online demo address is as follows:
http://demo.jb51.net/js/2015/js-taobao-alipay-ctrl-menu-demo/
The specific code is as follows:
<!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" lang="zh" xml:lang="zh"> <HEAD> <TITLE>支付宝的控制台菜单</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <STYLE type="text/css"> body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;} table{border-collapse:collapse;border-spacing:0;} fieldset,img{border:0;} body{font-size:12px;} #MyMenu{ margin: 10px auto; width: 760px;background: url(images/Account_Title_BgC.gif) repeat-x; height: 36px;} .MyMenubg{background: url(images/Account_Title_Bg.gif) no-repeat;} #QuickMenu{background: url(images/Account_Title_Bg.gif) no-repeat right -36px;text-align:left;} #QuickMenu a{font-size:12px;color:#003599;text-decoration:none;} #QuickMenu a:hover,#QuickMenu a:active{color:#FF6B00;} #QuickMenu span a.cc:hover ,#QuickMenu a.cc:active span{background: url(images/MyMenu_bg_on.gif) no-repeat 0px 6px;} #QuickMenu span a.cc {cursor:pointer;display:block;background: url(images/MyMenu_bg.gif) no-repeat 0px 6px;margin:0px 0px 0px 10px;width:154px;height:23px;padding:11px 5px 0px 25px;} #MyMenuLinks{border:1px solid #FE7E25;background:#FCD5AA;padding:3px;text-align:left;top:-3px;left:20px;width:240px;float:left;} #MyMenuLinks *{margin:0px;padding:0px;line-height:20px;} #MyMenuLinks li {color:#003599;font-weight:bold;float:left;width:208px;padding-bottom:15px;} #MyMenuLinks li.home a{display:block;border:1px solid #FFBD80;background:#FCF6DC url(images/MyMenu_home.gif) no-repeat 45px 5px;text-align:center;font-weight:normal;} #MyMenuLinks ul{clear:left;list-style:none;border:1px solid #FBDDB9;background:#FFF;width:208px;padding:15px 15px 0px 15px;float:left;} #MyMenuLinks ul ul{border:1px solid #FFF;background:#FFF;width:200px;padding:0px;} #MyMenuLinks li li{font-weight:normal;width:90px;background:url(images/MyMenu_Li_bg.gif) no-repeat 0px 6px;padding:0px 0px 0px 10px;} #all-links, #flying{display:none;margin-left:-35px;position:absolute;left:0;top:30px;} #flying{background:#fff;border:1px dashed #ccc;top:0;} #enter{position: relative;width:184px;} </STYLE> </HEAD> <BODY> <DIV id=MyMenu> <DIV class=MyMenubg> <DIV id=QuickMenu> <div id="enter"> <span><A id=cc href="#" class="cc">支付宝快速入口</A></span> <div id="flying"></div> <DIV id=all-links style="display:none;"> <DIV id=MyMenuLinks> <UL> <LI class=home><A class=R href="#">我的支付宝首页</A> </LI> <LI>账户管理 <UL> <LI><A href="#">账户余额查询</A> </LI> <LI><A href="#">账户信息管理</A> </LI> <LI><A href="#">支付宝卡通</A> </LI> </UL> </LI> <LI>资金管理 <UL> <LI><A href="#">充值</A> </LI> <LI><A href="#">提现</A> </LI> <LI><A href="#">账户明细查询</A> </LI> <LI><A href="#">提现申请查询</A> </LI> </UL> </LI> <LI>增值服务 <UL> <LI><A href="#">安全中心</A> </LI> <LI><A href="#">手机服务</A> </LI> <LI><A href="#">信使</A> </LI> <LI><A href="#">产品中心</A> </LI> </UL> </LI> </UL> </DIV> </DIV> </div> </DIV> </DIV> </DIV> <script type="text/javascript"> var $ = function(id){ return typeof id == 'string' ? document.getElementById(id) : id; } var flying = function(obj, w, h, callback){ var d = 10; var index = 0; var extend = 50; var step = {width:(w+extend)/d, height:(h+extend)/d, top:30/d}; var only; clearInterval(only); obj.style.display = 'block'; only = setInterval( function(){ index++; obj.style.width = ( index * step.width) + 'px'; obj.style.height = ( index * step.height) + 'px'; obj.style.top = ( index * step.top) + 'px'; obj.style.marginLeft = ( 0 - (index * step.width - 150))/2 + 'px'; if(index > d){ clearInterval(only); if(typeof callback == 'function') callback(obj); } } ,10); } var timer; $('enter').onmouseover = function(){ clearTimeout(timer); timer = setTimeout(function(){ if($('all-links').style.display == 'none'){ new flying($('flying'), 248, 293, function(obj){ $('all-links').style.display = 'block'; obj.style.display = 'none'; }); document.title = 'over--'+Math.random(); } },200); } $('enter').onmouseout = function(){ clearTimeout(timer); timer = setTimeout(function(){ $('all-links').style.display = 'none'; document.title = 'out--'+Math.random(); },200); } </script> </BODY> </html>
I hope this article will be helpful to everyone’s JavaScript programming.

JavaScript is the core language of modern web development and is widely used for its diversity and flexibility. 1) Front-end development: build dynamic web pages and single-page applications through DOM operations and modern frameworks (such as React, Vue.js, Angular). 2) Server-side development: Node.js uses a non-blocking I/O model to handle high concurrency and real-time applications. 3) Mobile and desktop application development: cross-platform development is realized through ReactNative and Electron to improve development efficiency.

The latest trends in JavaScript include the rise of TypeScript, the popularity of modern frameworks and libraries, and the application of WebAssembly. Future prospects cover more powerful type systems, the development of server-side JavaScript, the expansion of artificial intelligence and machine learning, and the potential of IoT and edge computing.

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

Python is more suitable for data science and machine learning, while JavaScript is more suitable for front-end and full-stack development. 1. Python is known for its concise syntax and rich library ecosystem, and is suitable for data analysis and web development. 2. JavaScript is the core of front-end development. Node.js supports server-side programming and is suitable for full-stack development.

JavaScript does not require installation because it is already built into modern browsers. You just need a text editor and a browser to get started. 1) In the browser environment, run it by embedding the HTML file through tags. 2) In the Node.js environment, after downloading and installing Node.js, run the JavaScript file through the command line.

How to send task notifications in Quartz In advance When using the Quartz timer to schedule a task, the execution time of the task is set by the cron expression. Now...

How to obtain the parameters of functions on prototype chains in JavaScript In JavaScript programming, understanding and manipulating function parameters on prototype chains is a common and important task...

Analysis of the reason why the dynamic style displacement failure of using Vue.js in the WeChat applet web-view is using Vue.js...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor