Coding with Jesse

Adding Style Blocks Using JavaScript

June 7th, 2007

Who’s Got Style? - Nicholas C. Zakas writes a good analysis of dynamically creating and attaching <style> elements to a page using JavaScript. He ends up with a function that works in Internet Explorer, Firefox, Opera and Safari.


Interested in web development? Subscribe to my newsletter!

Comments

1 . Rahul Rathore on July 28th, 2009

Rahul Rathore

Hi all,
I am looking for the scrollable gridview in asp.net but i don't want to use css class. instead of using css I want to give style to header row of the grid by using javascript function.
can anyone give some sugessions.
code which i have written is
function scrollGrid(gridControl)
{

th=document.getElementById("ctl00_ContentPlaceHolder1_grdScroll").getElementsByTagName('thead');
th.getElementsByTagName('tr').style.position='absolute';

}

window.onload=scrollGrid;
by using i want to give absolute position to header of the grid.

Regards,
Rahul

Comments are closed, but I'd still love to hear your thoughts.