HighDots Forums  

Re: How Does JavaScript Call Forth CSS??

Website Design comp.infosystems.www.authoring.site-design


Discuss Re: How Does JavaScript Call Forth CSS?? in the Website Design forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joshua Cranmer
 
Posts: n/a

Default Re: How Does JavaScript Call Forth CSS?? - 04-27-2008 , 09:05 PM






Prisoner at War wrote:
Quote:
Okay, Folks,

I guess my real burning concern all along is a "high-level" one: just
how does JavaScript interact with CSS?
Depends on what level of "interaction" you're specifying. Direct
manipulation of style rules is handled by something called the `CSS
Object Model' (still a WIP, IIRC); but computed style rules can be
affected by DOM mutations. It is the latter that is more often the case.

Quote:
Right now, my newbie self only knows JavaScript and CSS to *co-
exist*...but I'm beginning to get the sense that they actually
interact -- or, perhaps more precisely, JavaScript acts upon CSS...but
how, exactly??

I see how JavaScript acts upon HTML, but I'm not so sure where
JavaScript acts upon CSS...moreover, I want to see where they could
create whole new browsing experiences, beyond simply new text and new
images (though I'm only just beginning at the level of new ways of
presenting text and images)....
In short, most JavaScript tends to act on CSS only by proxy through the
HTML. In my code, I generally modify styles by changing the classes of
elements.

P.S. The `DOM', or `Document Object Model', is the precise specification
that most people think of when the think of JavaScript; any time you're
dynamically modify DOM (e.g. through document.getElementByID), you're
actually using the DOM. Most literature tends to gloss over this
distinction.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth


Reply With Quote
  #2  
Old   
Prisoner at War
 
Posts: n/a

Default Re: How Does JavaScript Call Forth CSS?? - 04-30-2008 , 10:06 PM






On Apr 27, 9:05 pm, Joshua Cranmer <Pidgeo... (AT) verizon (DOT) invalid> wrote:
Quote:

Depends on what level of "interaction" you're specifying. Direct
manipulation of style rules is handled by something called the `CSS
Object Model' (still a WIP, IIRC); but computed style rules can be
affected by DOM mutations. It is the latter that is more often the case.
So, the plot thickens! CSS has its own "Object Model," eh?

But it sounds like you're saying that CSS Object Model is a one-time
set-up, right, whereas JavaScript manipulation of CSS is "dynamic,"
correct? That's how I'm operating right now -- only learning CSS in
order for JavaScript to manipulate the page!

Quote:
In short, most JavaScript tends to act on CSS only by proxy through the
HTML. In my code, I generally modify styles by changing the classes of
elements.
Ahh, that's interesting: JavaScript has to "go through" the (X)HMTL in
order to mess with the CSS...any good DHTML resources or books you
might be able to recommend? Seems like that's what I'm really trying
to learn here -- not JavaScript as such, nor CSS, nor even good
graphic design principles, but that DHTML stuff that combines them
all....

Quote:
P.S. The `DOM', or `Document Object Model', is the precise specification
that most people think of when the think of JavaScript; any time you're
dynamically modify DOM (e.g. through document.getElementByID), you're
actually using the DOM. Most literature tends to gloss over this
distinction.
Indeed! Books tend to relegate the DOM, if they mention it at all,
quickly in passing, usually towards the end, as if it were an
"advanced" topic when it seems that the DOM should be taught first and
foremost! Knowing about the DOM is, for me, like finally finding a
chart of the Periodic Table...previously, I was simply blowing myself
up in the laboratory, mixing this and that! Now, at least I know what
and why! 8-)

Quote:
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.