Div + Js implemented with shadow menu, which was previously used by Microsoft website _ navigation menu

Source: Internet
Author: User
The Shadow menu implemented by Div + Js has been used by Microsoft on the homepage of an old version of the website to index all products of the Windows product family. This menu only implements a prototype, to achieve the same effect as Microsoft, it is estimated that much work is required. The purpose is for reference by friends who are learning CSS.

<Title> Div + Js-implemented shadow menu used by Microsoft websites before </title> script var global = zookeeper Doc ument global. fo_shadows = new Array function makeRectangularDropShadow (el, color, size) {var I; for (I = size; I> 0; I --) {var rect = document. createElement ('P'); var rs = rect. style rs. position = 'absolute '; rs. left = (el. style. posLeft + I) + 'px '; rs. top = (el. style. posTop + I) + 'px '; rs. width = el. offsetWidth + 'px '; rs. height = el. offsetHeight + 'px '; rs. zIndex = el. style. zIndex-I; rs. backgroundColor = color; var opacity = 1-I/(I + 1); rs. filter = 'Alpha (opacity = '+ (100 * opacity) +') '; el. insertAdjacentElement ('afterend', rect); global. fo_shadows [global. fo_shadows.length] = rect;} script <style> body, td, p, a, input {font: menu; line-height: 180%} </style> <p id = menu style = "position: absolute; left: 10px; top: 10px; background: # EEEEEE; width: 120px; height: 100px; padding: 3px; border: 1 #999999 solid; cursor: default "> <p style =" border: 1 solid # EEE "onmouseover =" this. style. background = '# CCC'; this. style. borderColor = '#999' "onmouseout =" this. style. background = '# EEE'; this. style. borderColor = '# EEE' "> Jb51.net </p> <p style =" border: 1 solid # EEE "onmouseover =" this. style. background = '# CCC'; this. style. borderColor = '#999' "onmouseout =" this. style. background = '# EEE'; this. style. borderColor = '# EEE' "> script home </p> <p style =" border: 1 solid # EEE "onmouseover =" this. style. background = '# CCC'; this. style. borderColor = '#999' "onmouseout =" this. style. background = '# EEE'; this. style. borderColor = '# EEE' "> webpage effects </p> script makeRectangularDropShadow (document. all ["menu"], "#666666", 4); 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.