"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Monday, October 24, 2011

Show Scroll Bar using javascript

 Hi *.*,
All the modern browsers support auto scroll bar.But when we create some popup with hiding menu-bar and status-bar the browser will not provide scroll bar by considering it a malicious actions !!!!Over that case the below script will help u 


window.onload = function ()
{
 var bodyElementsArray = document.getElementsByTagName('BODY');

 if ( (bodyElementsArray != null) && (bodyElementsArray.length > 0) )
 {
  var bodyElement = bodyElementsArray[0];

  bodyElement.scroll = 'yes';
 }
}

If u had any trouble just ask, Happy to help u :) 
Stay Tune... 
Have a nice day... 'N happy Coding :)

No comments: