[Javascript] dynamically reading/changing values in a css class from javascript

Troy III Ajnej trojani2000 at hotmail.com
Sat Jun 16 06:34:52 CDT 2007


Sorry I didn't Nick; 
But I did make the sugestion of what domain manipulation I'm talking
about with a simple example like: this.style.width="something" and I 
think its enough to understand  that we are talkin of js manipulation 
on dom elements which will not affect the stylesheet in any way.
 
The example method is also more secure and more certain that the 
change you've made will get drawn for sure! Since it deploys these 
changes inline making sure it makes it over all existing preceeding
declarations. I belive it is practicall. And yes, it is impossible to affect 
the style body itself with that method. 
[document.getElementById('anyElment').style.color=...etc]
 
Since we are not arguing, I believe that discusing the manipulation 
the style declarations could be benefituary for people in discusion. 
I myself, think that manipulating the style body itself is a bit unpractical,
still not very widely supported and in most casses unnecessary. 
 
The only casse, when I think it will come handy, is the casse when you
are forced to change some class style declarations that will affect all 
the elements belonging to that class selector. This is however very rare 
situation. And beyond that, you'll have to make sure somehow that 
the browser will really reflect these changes as and when expected. 
(As I'm not very familiar with how will some certain browser 
handle these changes in the body of the style element).
 
So in my point of view:
Even in the casse we are discussing, it is better to wallk the DOM and 
apply a different class to these elements allready declared in a style
than to mess with the stylesheet itself.
Regards.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        Troy III                            progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



> From: nick at customdesigns.ca> To: javascript at latech.edu> Subject: Re: [Javascript] dynamically reading/changing values in a css class from javascript> Date: Sat, 16 Jun 2007 01:13:42 -0600> CC: > > On Friday 15 June 2007 16:53, Troy III Ajnej wrote:> > Thank you Hassan,> > but I'm not interested te google anything since you could have quoted> > some of what you are saying.> >> > All the truths of the world have a limited validity. Because the truth> > resides in a certain domain.> > Even the main law of nature,the preservance of matter (mass and energy)> > is untrue if a particle falls inside a space of less than 10e-13m in> > diameter. That particle will disapear forever.> >> > I was tallking of a different domain...> > but you did not specify that in your original message, hence the response was > valid.> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Troy III progressive art> > enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> >> > > Date: Fri, 15 Jun 2007 06:50:07 -0700> From: hassan at webtuitive.com> To:> > > javascript at LaTech.edu> Subject: Re: [Javascript] dynamically> > > reading/changing values in a css class from javascript> > > > it is> > > impossible to change the CSS itself. > > Not true: google> > > 'document.styleSheets' for details...> > -- > Hassan Schroeder> > > ----------------------------- hassan at webtuitive.com> Webtuitive Design> > > === (+1) 408-938-0567 === http://webtuitive.com> opinion:> > > webtuitive.blogspot.com> > dream. code.> > >> > > _______________________________________________> Javascript mailing list>> > > Javascript at LaTech.edu>> > > https://lists.LaTech.edu/mailman/listinfo/javascript> >> > _________________________________________________________________> > Live Earth is coming. Learn more about the hottest summer event - only on> > MSN. http://liveearth.msn.com?source=msntaglineliveearthwlm> _______________________________________________> Javascript mailing list> Javascript at LaTech.edu> https://lists.LaTech.edu/mailman/listinfo/javascript
_________________________________________________________________
Hotmail to go? Get your Hotmail, news, sports and much more! Check out the New MSN Mobile! 
http://mobile.msn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070616/5dd15e31/attachment.htm>


More information about the Javascript mailing list