[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-20 Thread Brian J. Fink
Perhaps you forgot to use jquery.extend() to create your rule plugin, or maybe you should figure out a way to return jquery(jquery.rule) value instead. When I said unchainable, I meant that methods of the rule object break the chain for successive rule() calls, forcing the coder to insert ;$ to

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Brian J. Fink
Then why doesn't this statement work: $.rule('p{border: 1px solid green}').appendTo('style').rule('a','style').append('color: red'); Whereas these do? $.rule('p{border: 1px solid green}').appendTo('style'); $.rule('a','style').append('color: red'); On Jun 18, 4:32 pm, Ariel Flesler [EMAIL

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Ariel Flesler
Because .rule is property of jQuery, not a method of Rule objects. On 6/19/08, Brian J. Fink [EMAIL PROTECTED] wrote: Then why doesn't this statement work: $.rule('p{border: 1px solid green}').appendTo('style').rule('a','style').append('color: red'); Whereas these do? $.rule('p{border:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Brian J. Fink
Hence the word unchainable. Also, your plugin does not work on IE7. On Jun 19, 3:27 pm, Ariel Flesler [EMAIL PROTECTED] wrote: Because .rule is property of jQuery, not a method of Rule objects. On 6/19/08, Brian J. Fink [EMAIL PROTECTED] wrote: Then why doesn't this statement work:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-19 Thread Ariel Flesler
Hence the word unchainable. What do you mean ? The methods of rule objects are chainable, they always return the rule object. Of course a rule object doesn't have a 'rule' method that is, in fact, the rule constructor. Is like expecting something like this to work:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-18 Thread Brian J. Fink
Well, I was about to accuse you of a design flaw, but when I followed the examples in the demo page, I discovered the right way, and it works perfectly, even when there's more style tags than one. I still say it's a bit awkward. And no, they are not chainable, but if you make the rule object an

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-18 Thread Ariel Flesler
Well, I was about to accuse you of a design flaw, but when I followed the examples in the demo page, I discovered the right way, and it works perfectly, even when there's more style tags than one. I still say it's a bit awkward. I really don't understand why is it awkward. It behaves JUST like

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Ariel Flesler
There is a plugin for that, it's called Rule: http://flesler.blogspot.com/2007/11/jqueryrule.html Cheers -- Ariel Flesler http://flesler.blogspot.com On 16 jun, 05:32, Olaf Bosch [EMAIL PROTECTED] wrote: Brian J. Fink schrieb:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Brian J. Fink
Thanks for the pointer! Say, is there a way this functionality could be integrated into jQuery itself? I also think that the structure is still a little awkward, but I'm glad someone thought of it already. Can I chain like this? $.rule('a{text-decoration:none}','style').rule('h2{text-

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Brian J. Fink
@Hamish: Yes, that is what I had in mind, but more like: $(document).css('p','color: red; border: 1px gray inset').css('h1','font-size: 200%; text-align: center; text-transform: small-caps'); On Jun 16, 4:41 pm, Hamish Campbell [EMAIL PROTECTED] wrote: As an example do you mean:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-17 Thread Ariel Flesler
Thanks for the pointer! Say, is there a way this functionality could be integrated into jQuery itself? Nope. Can I chain like this? $.rule returns a Rule object with its own methods. I don't recall if the methods are chainable, maybe they are. Also consider that you may want to

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Olaf Bosch
Brian J. Fink schrieb: $(document).css(selector1,rule1).css(selector2,rule2)...css(selectorN,ruleN); If this is already part of the jQuery functionality, tell me the syntax to use. Yes, it's ON: $(p).css({ color: red, background: blue }); -- Viele Grüße, Olaf

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Brian J. Fink
I didn't mean $(element).css(object), I meant $ (document).css(selector,rule). The difference is this: css() as it stands makes a one-time change to the members of the jQuery object by adjusting the style attribute of each. When a new element matching the query string is created, it does not have

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Erik Beeson
This worked for me on FF2/Mac: $('style/style').attr('type', 'text/css').text('div { background: red; }').appendTo('head'); --Erik On 6/16/08, Brian J. Fink [EMAIL PROTECTED] wrote: I didn't mean $(element).css(object), I meant $ (document).css(selector,rule). The difference is this:

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Hamish Campbell
As an example do you mean: $(document).css('p', 'color: red').css('h1', 'font-size: 200%'); On Jun 14, 6:13 am, Brian J. Fink [EMAIL PROTECTED] wrote: I was tinkering with jQuery when I got an idea: why not have a way to do something like: $(document).css(selector,rule); Then it could