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\">&#9734</div>" 

my own javascript code:

    $(".favorite").click(         function(){             alert("in here");             var current_status = $(this).attr("status");             if(current_status == "off"){                 $(this).html("&#9733;");                 $(this).css({"color":"gold"});                 $(this).attr("status", "on");             }else if (current_status == "on"){                 $(this).html("&#9734;");                 $(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         }     }); }); 

jsfiddle


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -