PDA

View Full Version : AnyLink Drop Down Menu v2.2 with ASP



effyl01
04-25-2011, 03:34 PM
1) Script Title:
AnyLink Drop Down Menu v2.2
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
3) Describe problem:

Hello,
I am trying to run the Anylink in an ASP enviorment.
until now i just called for the CSS and the JS files in the <head> at the masterpage.master.

The problem is that my site is already build.
In the masterpage.master in the body sction it loads loads an array of pictures that make up the menu in the site.
and in the masterpage.master.CS there's an code that specifies what happens on mouse over.

Masterpage body:


<span id="menurightside">
<span id="menuhome" class="uppermenuitem"><asp:ImageButton ID="ButtonMenu_Home" runat="server" ImageUrl="~/AppImages/HeaderMenu_Home_off.gif" PostBackUrl="~/Default.aspx" /></span>
<span id="menuabout" class="uppermenuitem"><asp:ImageButton ID="ButtonMenu_About" runat="server" ImageUrl="~/AppImages/HeaderMenu_About_off.gif" PostBackUrl="~/About.aspx" /></span>
<span id="menumore" class="uppermenuitem"><asp:ImageButton ID="ButtonMenu_More" runat="server" ImageUrl="~/AppImages/HeaderMenu_More_off.gif" PostBackUrl="~/More.aspx" /></span>
</span>

The above code loads the menu pictures structure that is already build in the site.

The Masterpage.Master.cs loads the events for what happens in menuover and mouseout.


private void AddAttributes(string page)
{
if (page != "Home")
{
ButtonMenu_Home.ImageUrl = "AppImages/HeaderMenu_Home_off.gif";
ButtonMenu_Home.Enabled = true;

ButtonMenu_Home.Attributes.Add("onmouseout", "this.src='AppImages/HeaderMenu_Home_off.gif'");
ButtonMenu_Home.Attributes.Add("onmouseover", "this.src='AppImages/HeaderMenu_Home_on.gif'");
}

if (page != "About")
{
ButtonMenu_About.ImageUrl = "AppImages/HeaderMenu_About_off.gif";
ButtonMenu_About.Enabled = true;

ButtonMenu_About.Attributes.Add("onmouseout", "this.src='AppImages/HeaderMenu_About_off.gif'");
ButtonMenu_About.Attributes.Add("onmouseover", "this.src='AppImages/HeaderMenu_About_on.gif'");
}
.
.
.
.
.
.
private void SelectButtons(string page)
{
switch (page)
{
case "Home":
ButtonMenu_Home.ImageUrl = "AppImages/HeaderMenu_Home_over.gif";
ButtonMenu_Home.Enabled = false;
break;

case "About":
ButtonMenu_About.ImageUrl = "AppImages/HeaderMenu_About_over.gif";
ButtonMenu_About.Enabled = false;
break;

case "Customers":
ButtonMenu_Customers.ImageUrl = "AppImages/HeaderMenu_Customers_over.gif";
ButtonMenu_Customers.Enabled = false;
break;

default: break;
}
}
}


how can i intigrate the Anylink drop down menu, to work on mouse over, when approching the last menu picture called "More"?

Many thanks,
Effy.

effyl01
04-26-2011, 09:51 AM
If someone can help i'de appriciate it :)

Just to add something: When i used the Script "Pop-it menu" I could do in this syntax:


if (page != "More")
{
ButtonMenu_More.ImageUrl = "AppImages/HeaderMenu_More_off.gif";
ButtonMenu_More.Enabled = true;

ButtonMenu_More.Attributes.Add("onmouseout", "delayhidemenu()");
ButtonMenu_More.Attributes.Add("onmouseover", "showmenu(event,linkset[0])");
}