추천 버튼 문의...
본문
추천을 한번 누르면 추천했다고 나타났다가 자동으로 사라지는데
한번더 누르면 팝업창으로 이미 추천했다고 나오는데 팝업창대신에
추천 한번 누를때처럼 나타났다가 사라지게 할수없을까요?
답변 1
단순히 추천했다고 나오면서 사라지게 하려면 아래 소스를 참고하셔서 수정하시고
여러번 추천되게 하시려면 bbs/good.php 126line에 관련된 소스가 있습니다.
function excute_good(href, $el, $tx)
{
$.post(
href,
{ js: "on" },
function(data) {
if(data.error) {
alert(data.error);
return false;
}
if(data.count) {
$el.find("strong").text(number_format(String(data.count)));
if($tx.attr("id").search("nogood") > -1) {
$tx.text("이 글을 비추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
} else {
$tx.text("이 글을 추천하셨습니다.");
$tx.fadeIn(200).delay(2500).fadeOut(200);
}
}
}, "json"
);
}
</script>