2026, 새로운 도약을 시작합니다.

리스트 글씨제한에 관련하여

5년 전 조회 4,442

https://sir.kr/g5_skin/21139?sfl=wr_subject%7C%7Cwr_content&stx=ajax&page=3  님의 스킨을 적용하였습니다.

Copy




                        

 

 





var coll = true;

var other = null;

function collapse(href,id,comment)

{

    $.ajax({

            url: href,

            type: 'post',

            data: $(this).serialize(),

            success: function (data)

            {

                var content = /([\s\S]+?)/.exec(data);

                if($("#"+other).css("display") != "none")

                {

                    $("#"+other).empty();

                    $("#"+other).hide();

                }

                other = id;

                if(!comment)

                {

                    $("#"+id).html(content[1]);

                }

                else

                {

                    $("#"+id).html(content[1]);

                }

            },

            complete : function ()

            {

                if(!comment){

                    $(".view_content"+id).show();

                    if($("#"+id).css("display") == "none")

                    {

                        $("#"+id).show();

                        coll = true;

                    }else{

                        if(!coll)

                        {

                        $("#"+id).show();

                        if(other!=id)

                            $("#"+id).hide();

                        coll = true;

                        }

                        else

                        {

                            $("#"+id).hide();

                        }

                    }

                }else

                {

                    $(".view_content"+id).hide();

                    if($("#"+id).css("display") == "none")

                    {

                        $("#"+id).show();

                        coll=false;

                    }else{

                        if(coll)

                        {

                            $("#"+id).show();

                            coll=false;

                        }

                        else

                        {

                            $("#"+id).hide();

                        }

                    }

                }

            }

        });

}



 

1. 더보기에만 <a href="javascript:;" onclick="collapse('<?echo $list[$i]['h~~~)를 입힐 수 없을까요?

2. 더보기 클릭시 리스트의 글과 뷰의 글을 잇고 싶은데 160자 이후의 글만 이어져서 출력되게 할 수 있을까요?

고수님들의 도움 부탁드립니다 ㅜㅜㅜ

답변 2개

1. 아래와 같이 수정하시면 되구요..

Copy

2. 질문이 이해가 안되네요..

왜 굳이 160자 이후의 내용만 나오게 하실려는건지?

방법은 전체 내용에서 160자의 내용을 삭제하는 방법은 있습니다.

예) str_replace(apms_cut_text($list[$i]['wr_content'], 160,' '),"",$list[$i]['wr_content']);

로그인 후 평가할 수 있습니다

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

열공하시네요~~

로그인 후 평가할 수 있습니다

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

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

로그인
🐛 버그신고