How to implement a left-and-right menu on a control placed on a asp.net page and manipulate it (2)
Source: Internet
Author: User
Asp.net| Menu | controls | The page says the menu is created, and now it's Part two:
(2), select menu, click menu
Select the menu and click on the menu actually when the mouse MouseMove and click events. In the menustyle mentioned above, I implemented the pop-up menu with the Window.createpopup function provided by JavaScript, and the pop-up menu is a table. Each item in the table provides the MouseMove and click events.
I let him show a different style when the MouseMove incident happened.
When the Click event occurs, call the function Fnclick to make it happen to the task we need. Now to introduce the Menustyle () function.
function Menustyle () {
if (Window.navigator.appName = = "Microsoft Internet Explorer" && window.navigator.appVersion.substring ( Window.navigator.appVersion.indexOf ("MSIE") + 5, window.navigator.appVersion.indexOf ("MSIE") + 8) >= 5.5)
Isie = 1;
Else
Isie = 0;
if (Isie) {
menucontent = ' <table id= "rightmenu" width= "0" height= "0" cellspacing= "0" cellpadding= "0" style= "Font:menu;color: MenuText; " ><tr height= "1" ><td style= "Background:black" colspan= "4" ></td></tr><tr height= "10" ><TD style= "Background:black" ></td><td style= "Background:snow" ><table "0" cellpadding= "0" nowrap style= "Font:menu;color:menutext;cursor:default;" > '; This line is to draw a table, starting from below, add the items in the table, at the same time give the style of mouseover and so on. One of the most critical places is that the OnClick event occurs when the function called is Parent.fnclickmenu, with a special reminder that the function of the parent window is invoked.
The contents of the menu are the tables drawn above.
MenuPopup.document.body.innerHTML = menucontent;
Combined with the above ShowMenu (), the function, you can see how to implement the pop-up menu function method. In the Fnclickmenu function. You can easily add a variety of features that you want to deal with.
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