채택완료

width 없애는 방법좀요...

2016-06-20 (월) 10:14:13 3,447

width 없애는 방법좀요...

사진을 다른 사이트에서 드래그해서 퍼오면...

pc에서는 잘보이는데...

모바일에서는 width 크기 때문에 잘려서 나오더라고요...

그래서 width를 없애버릴려고 하는데...

없애는 방법 좀 알려주시면 감사하겠습니다...

예전에 다른분이 아래와 같이 알려주셨는데...안되서요..

ㅠㅠ

<script>

  $( document ).ready( function() {

    $("#content img").attr({"width":"", "height":""}).css({"max-width": "100%"});

    $("#content img").css({"width":"", "height":"", "max-width": "100%"});

  } );

</script>

방법과

<?php

preg_replace('/width/i','a',$wr_content);

?>

두방법이 안되는데...다른방법이 있으면 알려주세요...

|

답변 1개 / 댓글 4개

채택된 답변
+20 포인트

아래와 같이 해보세요.

Copy
<script>  $( document ).ready( function() {    $("#content img").removeAttr("width").removeAttr("height").css({"width":"auto", "height":"auto", "max-width": "100%"});  } );</script>

답변에 대한 댓글 4개

답변주셔서 감사합니다....근데 알려주신 소스는 어디에 넣어야하는거에요?

view.skin.php에 적용시켰는데 안되서요...ㅜㅜ
view.skin.php 가 맞아요.

안된다면 이렇게 다시 해 보세요.

[code]
<script>
$( document ).ready( function() {
setTimeout(function(){
$("#content img").removeAttr("width").removeAttr("height").css({"width":"auto", "height":"auto", "max-width": "100%"});
}, 300);
} );
</script>
[/code]


그누보드5 스킨을 기본으로 사용하고 있다면

위에서 "#content img" 라고 되어 있는 부분을 "#bo_v_con img" 라고 고쳐보세요.
알려주신대로 했는데도 안되네요...ㅜㅜ

모바일스킨 view.skin.php에 넣는거 맞죠?ㅜㅜ
맞아요.

url 을 알려주시면 좀 더 정확하게 답변 할수가 있습니다.

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