On 9 Mag, 23:05, Wizzud <[EMAIL PROTECTED]> wrote:
> An alternative...
thanks Wizzud, your code is much faster than mine!!
thank you very much ^^
Correct.
It's the same principle as the more recognisable...
var x = {one:'A', two:'B'};
var y = x.one;
var z = x['one'];
// y == z == 'A'
...except that in this case x.one (or x['one']) happens to be assigned
with a function instead of a string.
On May 10, 3:35 pm, andrea varnier <[EMAIL PROTE
thank you very much to the both of you!
I'll try and let you know :)
just a question for Wizzud: what is this? O_o
> me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide']();
if I get it, writing
me.show();
or
me['show']();
is the same? I didn't know.
thanks
andrea
I suppose it just depends whether it's faster to find and hide all
then filter some or all and show them, or to selectively hide/show
each of a known set?
Haven't tested so not sure.
On May 10, 4:22 am, Dave Methvin <[EMAIL PROTECTED]> wrote:
> How about this?
>
> $('#hotel_paese').change(functio
How about this?
$('#hotel_paese').change(function(){
$('#hotel_destinazione option').hide()
.filter(this.value? ("."+this.value) : "*").show();
});
I think I got that right...if not you can probably tell what I meant.
An alternative...
var destOpts = $('#hotel_destinazione option');
$('#hotel_paese').change(function(){
var sel_val = $(this).val() || '';
destOpts.each(function(){
var me = $(this);
me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide']
();
6 matches
Mail list logo