Posts

Showing posts from July, 2011

Java Script Floating Verticle Sidemenu like JQuery

Image
Now a days you have seen a floating menu, or a box in the right or left corner of many websites for feedback, contacts or for any other purpose. That is nothing but a jquery and jquery is advanced type of javascript. So here bellow is the code in Javascript is simple and easy. Copy the code and paste, a couple of images are also used. You can change the width and height according to your requirements. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Slide Menu</title> <style type="text/css"> * {     margin:0px;     padding:0px; } body {     font-family:Arial, Helvetica, sans-serif;     font-size:12px; } #sidemenu {     top:100px;     width:60px;     height:400px;     positio

Dynamic Title and Meta Data on Content Page having Master Page attached.

This is the most simple way to assign Title and Meta data on content page having Master Page attached. First add a Master Page in your .net website. The removes the title tag from the master page. Then add new page to your website and attach the master page with removed title tags. Now in the Page Load event of content page add the following line. Below is the simple code. protected void Page_Load(object sender, EventArgs e)     {         if (!IsPostBack)         {             HtmlTitle title = new HtmlTitle();             title.Text = "Dynamic Page";             Header.Controls.Add(title);             HtmlMeta tag = new HtmlMeta();             tag.Name = "keywords";             tag.Content = "key1, key2, key3, key4";             Header.Controls.Add(tag);             HtmlMeta des = new HtmlMeta();             des.Name = "desription";             des.Content = "This is a dynamic description allocated to the page...&quo

Change Css Class of li in ul onclick

Image
Below is the simple and a short code to change or set the background color of item in menu onclick or active tab of menu (i.e. li of ul) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>List Item</title> <style type="text/css"> ul {     list-style-type:none;     float:left;     border-bottom: solid 2px Red;     padding-right:40px; } ul li {     float:left;     width:auto;     padding:8px;     display:block;     cursor:pointer; } </style> <script type="text/javascript" language="javascript">     function checklist(ctrl)     {                 var list = document.getElementById("menu").getElementsByTagName('li&#