Wednesday, March 11, 2009

disable scroll bar

In some cases we would like to disable the scroll bar on the page in that case we can use the following lines in the appropiate section of the .aspx page. the code is as follows

[code]

< body style="overflow: hidden" >



[style type="text/css"]

body {
overflow-x: hidden;
overflow-y: scroll;
}

[/style]

[code]

Note: That all browsers doest not support this method (for instance IE for Mac still shows the scrollbars).

in my next article i will post the code how to handle those browsers...

Thanks and Regards
Meetu Choudhary
Founder http://www.msdotnetmentor.com

Tuesday, March 10, 2009

Show or Hide combobox at Runtime using JavaScript

Show or Hide combobox at Runtime using JavaScript

Many a times in the programming world we feel the need to hide or show the dropdown lists or combo boxes of the particular page or a div or anyother control so here is a small snippet

The Following is the JavaScript function to achieve the above you can embede it in any external JavaScript file or write as an inline script or include in the head section...


function showOrHideAllDropDowns(newState)
{

var elements = document.documentElement.getElementsByTagName('select');

for (var i=0; i
elements[i].style.visibility = newState;
} }




To use the Above function in a div we can write it like


< style="width:220px;" onmouseover="showOrHideAllDropDowns('hidden');" onmouseout="showOrHideAllDropDowns('visible');">





Thanks and Regards
Meetu Choudhary
Founderhttp://msdotnetmentor.com

Subscribe via email

Enter your email address:

Delivered by FeedBurner

MSDotnetMentor

MSDotnetMentor My Website http://msdotnetmentor.com