Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Same problem here, had to remove it because I was sick of playing with it.

    forgot to add a var that changes the text to the correct line.

    $("#togglecomments").click(function(){
    	var hideTxt = p2txt.hide_threads;
    	var showTxt = p2txt.show_threads;
    	if (hidecomments) {
    		commentLoop = false;
    		commentsLists.hide();
    		$.cookie('threads', 'hidden');
    		$(this).text(showTxt);
    	} else {
    		commentsLists.show();
    		$.cookie('threads', 'shown');
    		$(this).text(hideTxt);
    	}
    	hidecomments = !hidecomments;
    	return false;
    });
    	var showTxt = p2txt.show_threads; // add this
    	var threads = $.cookie('threads');
    	if (threads == 'hidden') {
    		commentsLists.hide();
    		$("#togglecomments").text(showTxt); //add this
    };

    This uses cookies to set a preference of open or closed, threads are closed by default. Just download the cookie plugin and link it in your header.

    $("#togglecomments").click(function(){
    	var hideTxt = p2txt.hide_threads;
    	var showTxt = p2txt.show_threads;
    	if (hidecomments) {
    		commentLoop = false;
    		commentsLists.hide();
    		$.cookie('threads', 'hidden');
    		$(this).text(showTxt);
    	} else {
    		commentsLists.show();
    		$.cookie('threads', 'shown');
    		$(this).text(hideTxt);
    	}
    	hidecomments = !hidecomments;
    	return false;
    });
    	var threads = $.cookie('threads');
    	if (threads == 'hidden') {
    		commentsLists.hide();
    		$(this).text(showTxt);
    };
Viewing 3 replies - 1 through 3 (of 3 total)