Jump to content

Parsing CSS stylesheets


Omirion

Recommended Posts

Hello,

I'm not sure how i can describe my problem so i will just explain my aim.

 

In general i want to parse a CSS sheet and extract the position properties of of every element.

Then i want to set the properties of every element (Mostly divs) using JS. (This part i can figure out on my own, but suggestions are welcome cause i'm thinking this is going to skull f*** the CPU )

 

In general i need a way to extract the position info from an external stylesheet.

 

Any ideas on the subject are more than welcome.

Even if they are purely theoretical.

 

Link to comment
Share on other sites

Why would you want to do this?

 

In general i need a way to extract the position info from an external stylesheet.

 

This doesn't exactly make sense, could you explain it a little more? What do you mean by "position info"?

Link to comment
Share on other sites

Why would you want to do this?

 

In general i need a way to extract the position info from an external stylesheet.

 

This doesn't exactly make sense, could you explain it a little more? What do you mean by "position info"?

 

Because i need to use those properties later in my script.

And there is no (at least as far as i know) way of getting position properties of external style sheets.

 

The position i.e position:absolute/static/etc

left:100%/40px

top:-||-

 

 

This jQuery CSS parser may be of interest to you.

 

Thanks i think this will work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.