[jQuery] Re: Manipulating a stylesheet directly

2007-07-06 Thread Sam Collett
I don't know if this will help (does not depend on jQuery): http://webdevel.blogspot.com/2006/06/create-css-class-javascript.html It's not been compared with using jQuery to alter CSS, but I think it may be faster. It modifies the CSS properties directly (replaces them with what you enter). It

[jQuery] Re: Manipulating a stylesheet directly

2007-07-05 Thread Gordon
Oh, forgot to mention, I thought I'd post some code here as an example of what I'd like to be able to do (though it's not possible yet) $('.someclass').each (function (thisElemNum) { var elem = $(this); var newProps= { left: someLeftVal,

[jQuery] Re: Manipulating a stylesheet directly

2007-07-05 Thread Gordon
Thanks for the help, but that's not quite what I had in mind. I need for the dimensions of my boxes to be animated when they change, I just thought that by doing it in a stylesheet instead of the style= attribute as jQuery uses currently I'd be able to get a big speedup as then I'd only have to

[jQuery] Re: Manipulating a stylesheet directly

2007-07-05 Thread Michael Geary
I think we are talking about the same thing, but coming at it from different angles. The code I posted is a building block you could use to write your own animation function. It's not the jQuery feature you want, just a start on it. :-) I meant to ask: how many elements are you animating

[jQuery] Re: Manipulating a stylesheet directly

2007-07-05 Thread başkan
sizin ne demek istediğinizi vallahi anlamıyorum:) On 5 Temmuz, 23:04, Michael Geary [EMAIL PROTECTED] wrote: I think we are talking about the same thing, but coming at it from different angles. The code I posted is a building block you could use to write your own animation function. It's not

[jQuery] Re: Manipulating a stylesheet directly

2007-07-04 Thread Michael Geary
You are definitely on the right track, Gordon. Here's the code you need: // Add a stylesheet with the given CSS styles (a text string) // and return a reference to it function addStyleSheet( css ) { var sheet = document.createElement( 'style' ); sheet.type =

[jQuery] Re: Manipulating a stylesheet directly

2007-07-04 Thread Michael Geary
I left out one line of code in my previous reply. Add this line before the two function definitions: var head = document.getElementsByTagName('head')[0]; Oops! :-) -Mike From: Michael Geary You are definitely on the right track, Gordon. Here's the code you need: // Add a