Tuesday, October 30, 2007

Dynamically updating CSS Style attributes

Just having a little fun with CSS style attributes and came up with a demo page to demonstrate javascript dynamically changing the attributes of some text on the screen.

Click here to see.

The javascript/CSS that makes this happens is:

var DHTML = (document.getElementById || document.all || document.layers);

if (!DHTML) return;
var x = new getObj('divtext');

document.getElementById('divtext').innerHTML = text;
x.style.fontSize = fontsize;
x.style.color = color;
x.style.fontFamily = fontfamily;
x.style.fontStyle = fontstyle;
x.style.fontWeight = fontweight;
x.style.backgroundColor = backgroundcolor;

}

function getObj(name)
{
if (document.getElementById)
{
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all)
{
this.obj = document.all[name];
this.style = document.all[name].style;
}
else if (document.layers)
{
this.obj = document.layers[name];
this.style = document.layers[name];
}
}




A little break from SOA and EA Frameworks :-)

9 comments:

Anonymous said...

Good day !.
might , probably very interested to know how one can reach 2000 per day of income .
There is no initial capital needed You may start to get income with as small sum of money as 20-100 dollars.

AimTrust is what you thought of all the time
AimTrust represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

It is based in Panama with affiliates around the world.
Do you want to become an affluent person?
That`s your choice That`s what you really need!

I`m happy and lucky, I began to take up real money with the help of this company,
and I invite you to do the same. If it gets down to choose a proper partner who uses your money in a right way - that`s the AimTrust!.
I make 2G daily, and my first deposit was 1 grand only!
It`s easy to get involved , just click this link http://jasaniqaqu.servetown.com/obokev.html
and go! Let`s take our chance together to get rid of nastiness of the life

Anonymous said...

Hi!
You may probably be very interested to know how one can manage to receive high yields on investments.
There is no need to invest much at first.
You may commense earning with a sum that usually is spent
for daily food, that's 20-100 dollars.
I have been participating in one company's work for several years,
and I'll be glad to share my secrets at my blog.

Please visit my pages and send me private message to get the info.

P.S. I earn 1000-2000 per day now.

http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

Anonymous said...

I am reading this article second time today, you have to be more careful with content leakers. If I will fount it again I will send you a link

Anonymous said...

Do you have copy writer for so good articles? If so please give me contacts, because this really rocks! :)

Anonymous said...

Glad to materialize here. Good day or night everybody!

Sure, you’ve heard about me, because my fame is running in front of me,
friends call me James F. Collins.
Generally I’m a venturesome gambler. recently I take a great interest in online-casino and poker.
Not long time ago I started my own blog, where I describe my virtual adventures.
Probably, it will be interesting for you to find out about my progress.
Please visit my web site. http://allbestcasino.com I’ll be glad would you find time to leave your opinion.

Term Papers said...

I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information... Regards

Anonymous said...

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
--------------------------
Visit my web: Poker Bonus No Deposit

Anonymous said...

If it will turn out to be as nicely full then it'll beginning pouring grass in to the blades which dulls them down.
Konigsburgs A Proud Taste for Scarlet and Miniver is an excellent fantasy
tale that features royalty.

My web site ... pick up lines in every language

Anonymous said...

wɑs listed by Forbes in its 2010 edition as the richest man in the Philippines
and was Һonored by the prestigious magazine in 2009 for being one
of the Filipino Heroes of Philanthropy. This will gіve tremendous relief to your back and in the long term this can actually be detrimental to tҺe heаlіng process.

There are mаny thіngs үou could notice, some you
will notice within a day or to some changes over the length of time.


Here is my webpage :: Restore My Vision pdf