An application of POPUP.

xiaoxiao2021-03-06  71

Many places have already mentioned menus that can be used on the web with popup window. There are many advantages: 1.Popup with inheritance, that is, the same level popup can only exist, but there are sons popup, grandson Popup, heavy grandson Popup. ..., this menu - submenu - Sun menu, heavy grandchildren menu ... very similar, haha, this family should pay attention to a pulse single biography, it is impossible to have brothers. 2 A popup in the .popup chain hides, all the windows below this popup are hidden. This feature really makes us very convenient. 3. It will not be covered by other forms or controls, for the past DIV, this problem is true A bit trouble. 4. Click anywhere outside the menu popup, and Popup is automatically hidden. 5. Others have not yet been thought of, but they have encountered a lot of problems in the application. Some of them can be referred to. Question: 1. Memory problem This is very important. After setting up a POPUP, it is not released in memory, so if you don't pay attention, its memory will use more. Finally, the browser can't work. Discovery is also Since I was lazy, the hiding of the menu is just a simple setting to null. In fact, the better method is this: The same menu uses only one popup, and keeps in memory, the sub-menu is this Popup Create a sub-popup. The same level menu is to switch, just a simple replacement window content (HTML). For example, a menu is 4 layers, then create a 4-step inherited window, not a total of how many menu inside it, Each menu creates a window. 2. For Popup display, try not to use first Show (0, 0, 1, 1, OBJ), then hide (), last in Show, because this will result in menu It will flash. Look at the eyes. It is best to calculate the positioning and size in advance show. 3. If you plan to use the outer-in-line CSS style sheet, Popup needs to use OnewChildwin.Document.createStylesheet ('menu.css') Additional CSS style sheet. Of course, if it is also added in the code. 4. For any Popup's content, you need to add the name of the POPUP as a reference object. The original window of the browser needs to add "Window" prefix. 5 When you leave the menu item with the subordinate menu, try not to hide the submenu of the menu item with OnMouseout, but use the ONMOUSEOVER event of other menu items to hide the submenu, if you use OnMouseout to hide this menu The submenu of the item, logic control will become complex 6. I didn't take the EVENT object when using the Popup object, it may not be available. So we can't use Event.Srcelement to get the trigger object of the event. So try to transfer the object with parameters. If you want Attchevent When you pass the parameters in the function, you can write: obj.attachevent ("onmouseover", function () {fntrueFunction (obj);}); 7. The logic hidden displayed is a more troublesome thing. You still have to write one before doing Process.

Popup makes menu I think of these, welcome everyone to communicate with me. I wish you all Popup pleasure.

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

New Post(0)