[jQuery] Re: div contains -> select div but NOT li

2009-04-28 Thread Ricardo
> or a less efficient but explanative way: > > > > $('#plan').click(function(){ > > >    //do stuff}); > > > > $('#plan li').click(function(e){ //or #plan > * > > >      return false; > > >      //returning false calls e.stop

[jQuery] Re: div contains -> select div but NOT li

2009-04-28 Thread gostbuster
gt;      //returning false calls e.stopPropagation() and e.preventDefault > > () > >   }); > > > cheers, > > - ricardo > > > On Apr 27, 10:26 am, Remon Oldenbeuving > > wrote: >

[jQuery] Re: div contains -> select div but NOT li

2009-04-28 Thread gostbuster
and e.preventDefault > () >   }); > > cheers, > - ricardo > > On Apr 27, 10:26 am, Remon Oldenbeuving > wrote: > > > It looks obvious, but aint working for me. > > > On Mon, Apr 27, 2009 at 3:16 PM, Mauricio (Maujor) Samy Silva < > > &g

[jQuery] Re: div contains -> select div but NOT li

2009-04-28 Thread gostbuster
orking for me. > > > On Mon, Apr 27, 2009 at 3:16 PM, Mauricio (Maujor) Samy Silva < > > > css.mau...@gmail.com> wrote: > > > > De: "gostbuster" > > > Assunto: [jQuery] Re: div contains -> select div but NOT li > > > Hi, > >

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Ricardo
On Apr 27, 10:26 am, Remon Oldenbeuving wrote: > It looks obvious, but aint working for me. > > On Mon, Apr 27, 2009 at 3:16 PM, Mauricio (Maujor) Samy Silva < > > css.mau...@gmail.com> wrote: > > > De: "gostbuster" > > Assunto: [jQuery] Re: div contai

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Remon Oldenbeuving
It looks obvious, but aint working for me. On Mon, Apr 27, 2009 at 3:16 PM, Mauricio (Maujor) Samy Silva < css.mau...@gmail.com> wrote: > > > De: "gostbuster" > Assunto: [jQuery] Re: div contains -> select div but NOT li > Hi, > Yes of course I could do t

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Mauricio (Maujor) Samy Silva
De: "gostbuster" Assunto: [jQuery] Re: div contains -> select div but NOT li Hi, Yes of course I could do this, but Jquery selectors don't allow what I wish to do? Thanks. -- How about: $('

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Charlie
what you are doing is called event delegation, there's more to it than simple selectors . You could be clicking in the div but not on an li or clicking on the contents of an li. That's what was meant by "  //You will have to check whats the real target " for a list item $('#plan').click(funct

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread gostbuster
Hi, Yes of course I could do this, but Jquery selectors don't allow what I wish to do? Thanks. On 27 avr, 14:25, Remon Oldenbeuving wrote: > You could use the event object thats being passed when a click event fires? > > $('#plan').click(function(e){ >  if(e.target !== "liobject"){ //You will

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Remon Oldenbeuving
You could use the event object thats being passed when a click event fires? $('#plan').click(function(e){ if(e.target !== "liobject"){ //You will have to check whats the real target for a list item //here your code } }); On Mon, Apr 27, 2009 at 2:08 PM, gostbuster wrote: > > Okay I'll try to

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread gostbuster
Okay I'll try to explain better. Imagine an image, it's a rectangle. you can have a div with this image for background : like this : Then, with CSS, you can do this : #plan{ background:url(my image url); width : image width; height: image height } Well, my image is representing

[jQuery] Re: div contains -> select div but NOT li

2009-04-27 Thread Charlie
your question isn't very clear . If you are trying to select based on what is inside the div these should help: $("div:contains("Some Text")).// do something or $("div:has(li[class=something])").// do something http://docs.jquery.com/Selectors need to be more specific what you are trying