4:19:50 -0700
> Subject: [jQuery] Re: Shorten the JQuery code
> From: michaell...@gmail.com
> To: jquery-en@googlegroups.com
>
>
> Guess it depends on who the next guy is :)
>
> On Apr 16, 2:16 pm, "Andy Matthews" wrote:
> > I'd be careful with code
Yep. I like it, and it's really nice...giving you more options.
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of mkmanning
Sent: Thursday, April 16, 2009 4:20 PM
To: jQuery (English)
Subject: [jQuery] Re: Shorten the JQuery
That's already in the core :)
$('#no-defs').toggle( !$('.def').length );
http://docs.jquery.com/Effects/toggle#switch
- ricardo
On Apr 16, 5:54 pm, MorningZ wrote:
> There isn't much you can do with that since you can't conditionally
> code in ".show" or ".hide" unless you made a plugin to pa
: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Joseph Le Brech
> Sent: Thursday, April 16, 2009 4:12 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Shorten the JQuery code
>
> I'm impressed by the [] brackets, does that eval() the &
; and 'show'
> strings?
>
>
>
> > Date: Thu, 16 Apr 2009 14:08:09 -0700
> > Subject: [jQuery] Re: Shorten the JQuery code
> > From: michaell...@gmail.com
> > To: jquery-en@googlegroups.com
>
> > $('#no-defs')[$('.def').length==0?'
$('#no-defs')[$('.def').length==0?'show':'hide']();
Whoa
so
$("...")["show"]()
is equiv
$("...").show()
that kinda makes sense thinking about the way arrays work in JS..
slick
On Apr 16, 5:08 pm, mkmanning wrote:
> $('#no-defs')[$('.def').length==0?'show':'hide']();
>
> On Apr 16, 1:54 p
2 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Shorten the JQuery code
I'm impressed by the [] brackets, does that eval() the 'hide' and 'show'
strings?
> Date: Thu, 16 Apr 2009 14:08:09 -0700
> Subject: [jQuery] Re: Shorten the JQuery code
I'm impressed by the [] brackets, does that eval() the 'hide' and 'show'
strings?
> Date: Thu, 16 Apr 2009 14:08:09 -0700
> Subject: [jQuery] Re: Shorten the JQuery code
> From: michaell...@gmail.com
> To: jquery-en@googlegroups.com
>
>
>
$('#no-defs')[$('.def').length==0?'show':'hide']();
On Apr 16, 1:54 pm, MorningZ wrote:
> There isn't much you can do with that since you can't conditionally
> code in ".show" or ".hide" unless you made a plugin to pass in a true/
> false parameter and decide in the plugin, for instance
>
> $("#
or try
ndfs=$('#no-defs');($('.def').length == 0) ? ndfs.show() : ndfs.hide();
> Date: Thu, 16 Apr 2009 13:54:07 -0700
> Subject: [jQuery] Re: Shorten the JQuery code
> From: morni...@gmail.com
> To: jquery-en@googlegroups.com
>
>
> There isn
There isn't much you can do with that since you can't conditionally
code in ".show" or ".hide" unless you made a plugin to pass in a true/
false parameter and decide in the plugin, for instance
$("#no_defs").conditionalShow($('.def').length == 0);
On Apr 16, 4:27 pm, Dragon-Fly999 wrote:
> Co
11 matches
Mail list logo