Jquery Tabs on click option -
i'm using jquery tabs. on click, i'm trying display alert message (and make coloring changes). neither of works -- i'm not sure why when move out of tabs part regular html works perfectly. here's relevant code:
in addtab() jquery tabs:
tabcontenthtml = "<div class=\"favorite\" status=\"off\">☆</div>"
my own javascript code:
$(".favorite").click( function(){ alert("in here"); var current_status = $(this).attr("status"); if(current_status == "off"){ $(this).html("★"); $(this).css({"color":"gold"}); $(this).attr("status", "on"); }else if (current_status == "on"){ $(this).html("☆"); $(this).css({"color":"#efefef"}); $(this).attr("status", "off"); } } );
note see star in tab, it's not responsive!
there no click
method jquery ui tabs. instead called activate
method,
$(function () { $("#tabs").tabs({ activate: function (event, ui) { alert("i'm triggered"); //within can wtite todos } }); });
Comments
Post a Comment