Javascript problems that make me very depressed

Source: Internet
Author: User

To prevent the Javascript Menu Control Program I wrote from being covered by the drop-down list control, I modified the original program. The program is ready, but it is only found when it is used. Sometimes the menu cannot be displayed, and sometimes it is OK. For HTML webpages with the same display menu, I double-click it to open the display menu, but the address mapped to the virtual directory via IIS cannot be displayed again, then you can open this address on another machine and access it again !!!

I have uploaded the webpage to this address: http://gf.yf163.com/tmp/js/menu_xp.htm I can't display the menu when I open it with my computer, but I can see it on another computer of my colleague. Let me know if the menu can be displayed. Please leave a message to me. Thank you!

After tracking and debugging the program for a long time, I finally found that the problem was so strange as I thought !! Code for lines 161st and 162 of the menu Program (alai_menu_xp.js:

M. style. pixelleft = X;
M. style. pixeltop = y;

This is easy to understand and is used for menu positioning, but the problem exists here. I add a line of code before and after this code: Alert (M. Body. outerhtml )? This is the HTML code used to display the generated menu. You can imagine that the output code should be the same except for the changes to the top and left attributes. In fact, if it is displayed during the test, the result is as follows. If it is not displayed, the expected HTML code is displayed. However, after the two attributes are changed, the HTML code is changed for no reason. This is the result of a test:

<Div style = "Z-INDEX: 33; left:-200px; visibility: hidden; width: 200px; color: black; position: absolute; top: 35px; Background-color: white "> </div>

The menu content is lost after the two lines of code !!!!!!

Fainted !!!!!!!!

 

The old menu Program (except will be covered by the drop-down list, very easy to use) please visit http://www.9499.net? Go = tc

New Program (temporary )? Http://gf.yf163.com/tmp/js/alai_menu_xp.js

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.