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
;$
t
> 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:
$('div').hide().$('p').sh
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 s
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(
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 PRO
>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 lik
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
e
> 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 distin
@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:
>
> $(docume
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-
align:cente
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:
>
> > $(document).css(selector1,rule1).css(selector2,rule2)...cs
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 i
This worked for me on FF2/Mac:
$('').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: css() as i
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
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
-
15 matches
Mail list logo