Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
See more:
i got some javascript like this to add menu to asp.net form. but when i am trying to reduce the size for the windows its not toggling. just hiding the menu bar. What is the wrong with this code.

JavaScript
function sh() {
          if (ww < 1020) { $(".menutd").hide(); $("#slideimg").attr('src', '/Images/Right-Arrow.png'); }
          else { $(".menutd").show(); $("#slideimg").attr('src', '/Images/Left-Arrow.png'); }
          if (ww < 980) { $(".bdiv").width(980); $(document.body).css("overflow", "scroll"); }
          else { $(".bdiv").width(ww); $(document.body).css("overflow", "hidden"); }
          $(".slidertd, .lmenucont").height(wh - 82);
          $("#contframe").height(wh - 78);
          $("#treemenu").show('slow'); hp();
      }
Posted
Updated 27-Jul-15 1:36am
v7
Comments
jgakenhe 26-Jul-15 10:34am    
Use a Repeater and inside that Repeater you can add your links.
Suvendu Shekhar Giri 26-Jul-15 10:39am    
Format the question correctly so that someone can read correctly.
tastini 26-Jul-15 10:47am    
please check now.
Sreekanth Mothukuru 27-Jul-15 5:35am    
I suggest you to use recursive function to format all menu items which were already retrieved from the database.

Recursive method is used to build Menu and Sub menu at n no of levels. Give it a try.
tastini 27-Jul-15 5:47am    
can you give me sample code. it will help for me. Thanks

1 solution

I hope this helps you in adding recurring function to build menu dynamically:

How to Dynamically load Menus and Submenus from Database in ASP,Net MVC3 Razor[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900