in 1.3 it will be something like this

$(),live('click', function(){

});


or you can do something like this in 1.2.6

$().click(function(e){
  e = e.target || e.srcElement;

  if $(e).is('CSS selector')
     fire the function

});

adding some bubbling

$().click(function(e){
  e =e.target || e.srcElement;
  obj = e;
  ancestors = [];

  while(obj) {
    ancestors.push(obj);
    obj = obj.parentNode;
  }

  if $(ancestors).is('CSS selector')
     fire the function
});

still needs a lot of work but should be a starting point. Good luck.

On Jan 12, 4:13 am, Nedim <nedi...@gmail.com> wrote:
> Thank you.
> I will check it later.
>
> On Jan 11, 3:01 pm, Mike Alsup <mal...@gmail.com> wrote:
>
> > > This is in html (by default)
>
> > >       <input type="hidden" id="brojacgrupa" value="1" />
> > >       <div id="grupe">
> > >          <div id="grupa1" class="grupa">
> > >              <input type = "hidden" id="grupa1" value="1"/>
> > >                <div class="dodatni-sastojci"><span class="naslov-
> > > pos">Kolicina</span> <span class="kolicina-pos">Naslov</span></div>
>
> > >                 <div id="grupa-sadrzaj">
> > >                     <div id="grupa-list">
> > >                     <div>
> > >                         <div class="dodani-sastojci"><input
> > > name="vrijednosti[][1][kol]" type="text" title="Količina npr. 100ml,
> > > 10 kom i sl." /> </div>
> > >                         <div class="dodani-sastojci"><input
> > > name="vrijednosti[][1][naziv]" type="text" title="Primjer: U polje
> > > količina unesete 10 kom, a u naslov jaja."  /></div>
> > >                          <div class="dodani-clear"></div>
> > >                     </div>
> > >                 </div>
>
> > >                         <span class="novisastojak">Dodaj sastojak</
> > > span></div>
> > >              </div>
> > >        </div>
>
> > >   <div id="grupanovi"> </div>
> > >        <span id="novagrupa">Nova grupa</span>
>
> > > When i click on "grupanovi" it creates:
>
> > > $('#grupanovi').append('<div id="grupe"><div
> > > id="grupa'+document.getElementById('brojacgrupa').value+'"
> > > class="grupa"><input type = "hidden" id="grupa'+document.getElementById
> > > ('brojacgrupa').value+'" value="'+document.getElementById
> > > ('brojacgrupa').value+'"/><div class="dodatni-sastojci"><span
> > > class="naslov-pos">Kolicina</span> <span class="kolicina-pos">Naslov</
> > > span></div><div id="grupa-sadrzaj"><div id="grupa-list"><div><div
> > > class="dodani-sastojci"><input name="vrijednosti[][1][kol]"
> > > type="text" title="Količina npr. 100ml, 10 kom i sl." /> </div><div
> > > class="dodani-sastojci"><input name="vrijednosti[][1][naziv]"
> > > type="text" title="Primjer: U polje količina unesete 10 kom, a u
> > > naslov jaja."  /></div><div class="dodani-clear"></div></div></
> > > div><span class="novisastojak">Dodaj sastojak</span></div></div></
> > > div>');
>
> > > But this works only on default:
>
> > >  $(".novisastojak").click(function(){
> > >           alert('testiram');
>
> > >          });
>
> > > not on dynamical content created.
>
> > > Help?
>
> > >           });
>
> > Here's two resources you should read:
>
> >http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...
>
> >http://www.learningjquery.com/2008/03/working-with-events-part-1
>
> > Note that with the soon-to-be-released 1.3 version of jQuery this
> > situation will be much easier to handle.
>
> > Mike

Reply via email to