Let me feel extremely depressed JavaScript problem

zhaozj2021-02-16  109

In order to let me write the JavaScript menu controller that is not covered by the drop-down list control, I have modified the original program. The program is done, but it is found when used, sometimes the menu does not display, sometimes it can. For the same display menu, I directly double-click to open the display menu, but through the address of the IIS mapping virtual directory, open it, then open this address on another machine and display! ! !

I have already transferred the page to this address: http://gf.yf163.com/tmp/js/menu_Xp.htm I have now used my computer access to open, but there is no menu, but another in my colleague Computer access can be seen. Dear help me see if I can display the menu, and I will tell me in the back message, thank you!

I have tracked the program for half a day, and finally I found the problem, it is more than I imagined! ! Code of lines 161 and 162 of the menu program (Alai_Menu_XP.js):

M.Style.pixelleft = x; m.Style.pixeltop = Y;

This is easy to understand, it is used to make a menu positioning, but the problem is actually in this place. I join a line of code in front of this code: Alert (m.body.outerHTML)? This is the HTML code used to display the generated menu, you can imagine its output in addition to the TOP and LEFT properties The code should be the same. In fact, if you can display it, the result is this. If not, the previously displayed is the expected HTML code, but after the change of the two attributes change, the HTML code has changed without reason, this is the result of a test display in a certain test:

转载请注明原文地址:https://www.9cbs.com/read-10221.html

New Post(0)