$(document).ready(function() { jQuery.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; $("#comment_link").bind("click", function(e) { $.scrollTo("#comments", 1000, {offset: -24}); }); $("#join_link").bind("click", function(e) { $.scrollTo("#join", 1000, {offset: -24}); }); $("#notify_link").live("click", function(e) { var params = $(this).attr('rel').split(':'); var article_id = params[0]; var action = params[1]; if(action == 'subscribe') { $("#notify").addClass("remove"); $("#notify").removeClass("subscribe"); } if(action == 'remove') { $("#notify").addClass("subscribe"); $("#notify").removeClass("remove"); } $.ajax({ type: "GET", url: "/scripts/article_notify.php", data: "action=" + action + "&article_id=" + article_id, cache: false, success: function(html) { $("#notify").empty(); $("#notify").append(html); } }); }); });