Jump to content
php.lv forumi

jQuery funkcija nestrādā pēc itas funkcijas izpildes


ziedinjsh

Recommended Posts

Sveiki!
Es izmantoju šādu pieeju lai pārslēgu tabus: 

 jQuery(function() {
    jQuery('.box a').livequery('click', function(e){
        switch_tabs(jQuery(this));
    });

    switch_tabs(jQuery('.defaulttab'));

function switch_tabs(obj){
    jQuery('.box-content').hide();
    jQuery('.box a').removeClass('selected');
    var id = obj.attr("rel");

    jQuery('#'+id).show();
    obj.addClass("selected");
}

});

 

Viss trādā, bet kad jQuery pārlāde Div tagu kur ir iekšā ši funkcija tad vairs nestrādā, tiek parādīti visi tabi, kapēc  tā?

Edited by ziedinjsh
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...