Sorry for the terse response, but you might want to check out
getComputedStyle/currentStyle

On Mar 12, 10:33 am, "sfea...@gmail.com" <sfea...@gmail.com> wrote:
> Thanks for the response.  I want to make it standard across the site
> so I can do a simple call to display whatever style(s) of that
> particular element (in this case an h1).  Is there any method I can
> call that will return the entire css definition for the element in
> question?  Maybe return as a string and then I can print it on the
> screen?
>
> On Mar 12, 11:02 am, Leonardo K <leo...@gmail.com> wrote:
>
> > I don't know if I understand but u can return the css using the css method
> > like:
>
> > $("h1").css("color"); //return the color
> > $("h1).css("background-color"); //return the backgrund-color
>
> > U have to call the css method for every property in css.
>
> > On Thu, Mar 12, 2009 at 12:50, sfea...@gmail.com <sfea...@gmail.com> wrote:
>
> > > Sorry I don't want to sound like I'm asking for the solution, just a
> > > point in the right direction on where to start.  Thanks!
>
> > > On Mar 12, 10:28 am, "sfea...@gmail.com" <sfea...@gmail.com> wrote:
> > > > Hey there.  I'd like to start out by saying I'm new to jQuery, so if I
> > > > am not making sense, please let me know.  I'm creating a sort of style
> > > > guide to my website for viewers to look up the current styles used on
> > > > the site.  Kind of like the jQuery docs section actually.
>
> > > > I currently have it set up to display an example, and the HTML of the
> > > > example, using a simple little script that grabs the html out of the
> > > > specified div I'm using for the examples.  I would also like to add a
> > > > css function that returns the css from the stylesheet of that
> > > > particular object I'm displaying.  So if I wanted to display what the
> > > > H1 tags look like it would go something like this
>
> > > > H1 Tag
>
> > > >   HTML
>
> > > >     <h1>This is an H1 Tag</h1>
>
> > > >   Example
>
> > > >     This is an H1 Tag
>
> > > >   Css
>
> > > >     h1 {
> > > >       .....
> > > >     }
>
> > > > Of course it looks a lot prettier than that but you get the jist of
> > > > the idea.  How would I go about traversing the CSS and grabbing that
> > > > style associated with the current example, then returning that
> > > > style?

Reply via email to