미채택 완료

이글을 추천했습니다 텍스트말고 다른건 안될까요?

2016-12-10 (토) 23:41:38 3,705

f672effa86d526ca3dbaae9425b01e4c_1481276398_7962.png

 

 

<script>

$(function() {

    $("a.view_image").click(function() {

        window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");

        return false;

    });

 

// 추천, 비추천

    $("#good_button, #nogood_button").click(function() {

        var $tx;

        if(this.id == "good_button")

            $tx = $("#bo_v_act_good");

        else

            $tx = $("#bo_v_act_nogood");

 

        excute_good(this.href, $(this), $tx);

        return false;

    });

 

    // 이미지 리사이즈

    $("#bo_v_atc").viewimageresize();

});

 

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>

<!-- } 게시글 읽기 끝 -->


 

일단 비추천은 필요없고요 

추천의 경우 이글을 추천했습니다 텍스트 대신

    폰트나 '<i class="fa fa-star-o" aria-hidden="true"></i>';

이미지로는 출력이 안될까요???

도움 부탁 드립니다

|

답변 1개 / 댓글 1개

2016-12-10 (토) 23:47:49

ID가 bo_v_act_good인 테그를 찾아서 div로 수정후 위치는 css로 적당히 조절하시고,

$tx.html("<i class="fa fa-star-o" aria-hidden="true"></i>"); 

하시거나 div에 <i class="fa fa-star-o" aria-hidden="true"></i>테그를 미리 넣어두시고

$tx.text("이 글을 추천하셨습니다.");를 주석이나 삭제하는 방법이 있을수 있겠습니다. 

정확하게는 직접 해보지않아 확답하기 힘듭니다만 아마 될거 같고요 

약간의 오류가 있더라도 힌트가 되리라 생각됩니다 ㅎㅎ

답변에 대한 댓글 1개

말씀하신대로 적용해도 생각처럼 잘되지 않습니다 ㅜㅜ

답변을 작성하려면 로그인이 필요합니다.