쪽지보내기 사진이미지가 늘어나버리는데요
관련링크
본문
쪽지보내기 3개가 width 크기가에따라 이미지가 늘어져버리는데요 수정을 못하겠네요
소스코드입니다.
<!-- Owl Carousel Assets -->
<form name="friend_add">
<input type="hidden" name="fr_id" id="fr_id">
<input type="hidden" class="ed" name="mb_id" value="<?=$member[mb_id]?>" />
<input type="hidden" class="ed" name="fr_type" value="online" />
<input type="hidden" id="chk_fr_no" name="chk_fr_no[]" value="" />
<input type="hidden" id="mode" name="mode" value="insert" />
<div id="demo">
<div id="owl-demo2" class="owl-carousel">
<?
/*랭킹순서*/
//echo $rank_sql2="select DISTINCT mb_id, mb_name,mb_3,mb_sex,mb_2,mb_open from $g5[member_table] where mb_open='1' and mb_2='".$select2."' order by rand() limit 20";
$rank_sql2="select DISTINCT mb_id, mb_name,mb_3,mb_sex,mb_2,mb_open from {$g5['member_table']} where mb_open=1 and mb_2=1 and mb_leave_date=0 order by rand() limit 8";
$result_rank2=sql_query($rank_sql2);
$rank_list2 = array();
$frid = array();
$k=0;
$photo = array();
while ($rank_mb2 = sql_fetch_array($result_rank2)){
$rank_list2[] = $rank_mb2;
//echo $myphoto=mb_photo($rank_list2[$k][mb_id]);
$profile_rank_path2 = "{$g5[path]}/data/member/profile/{$rank_list2[$k][mb_id]}.jpg";
$photo_filename='';
$dest_path = G5_DATA_PATH.'/member/profile/';
$dest_url = G5_DATA_URL.'/member/profile/';
// 회원이미지 경로
$mb_img_path = G5_DATA_PATH.'/member_image/'.substr($rank_list2[$k][mb_id],0,2).'/'.get_mb_icon_name($rank_list2[$k][mb_id]).'.gif';
$mb_img_filemtile = (defined('G5_USE_MEMBER_IMAGE_FILETIME') && G5_USE_MEMBER_IMAGE_FILETIME && file_exists($mb_img_path)) ? '?'.filemtime($mb_img_path) : '';
$mb_img_url = G5_DATA_URL.'/member_image/'.substr($rank_list2[$k][mb_id],0,2).'/'.get_mb_icon_name($rank_list2[$k][mb_id]).'.gif'.$mb_img_filemtile;
$photo_name = $rank_list2[$k][mb_id].'.jpg';
$photo_file = $dest_path.$photo_name;
// 사진이 있다면 변수 넘김
if(file_exists($mb_img_path)){
$photo[$k] = '<img class="user-photo" src="'.$mb_img_url.'" width=100 height=100 >';
//img-responsive
$frid[$k]=$rank_list2[$k][mb_id];
$rank2[$k]="<a href=\"{$g5[path]}/g5/plugin/test-maker/automatch.php?mb_id={$rank_list2[$k][mb_id]}\" target='_blank'>{$photo[$k]}</a>";
}else{
$photo[$k] = "<img class='user-photo' src='".G5_IMG_URL."/no_img.gif' height=100 >";
$frid[$k]=$rank_list2[$k][mb_id];
$rank2[$k]="<a href=\"{$g5[path]}/g5/plugin/test-maker/automatch.php?mb_id={$rank_list2[$k][mb_id]}\" target='_blank'>{$photo[$k]}</a>";
}
$k=$k+1;
}
?>
<?for($s=0;$s<8;$s++){?>
<div class="item"><?=$rank2[$s]?>
<a class="btn btn-primary" href="<?=$g5[path]?>/g5/bbs/memo_form.php?me_recv_mb_id=<?=$frid[$s]?>" target="_blank" style="color:#000;margin-top:10px">쪽지보내기</a>
</div>
<?}?>
</div>
</div>
</form>
<style>
#owl-demo2 .item{
margin: 5px;
color: #FFF;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
text-align: center;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
var owl2 = $("#owl-demo2");
owl2.owlCarousel({
// Define custom and unlimited items depending from the width
// If this option is set, itemsDeskop, itemsDesktopSmall, itemsTablet, itemsMobile etc. are disabled
// For better preview, order the arrays by screen size, but it's not mandatory
// Don't forget to include the lowest available screen size, otherwise it will take the default one for screens lower than lowest available.
// In the example there is dimension with 0 with which cover screens between 0 and 450px
itemsCustom : [
[0, 2],
[450, 4],
[600, 7],
[700, 9],
[1000, 10],
[1200, 12],
[1400, 13],
[1600, 15]
],
navigation : true
});
});
function frined_add(id){
if(!g5_is_member){
alert("로그인후 이용하여주세요.");
location.replace('<?=$g5[path]?>/g5/bbs/login.php');
return;
}
var f = document.friend_add;
f.chk_fr_no.value=id;
f.fr_id.value=id;
var str = "추가";
if (!confirm("선택한 친구를 정말 "+str+" 하시겠습니까?\n\n"))
return;
f.action = "<?=$g5[path]?>/g5/bbs/friend_update.php?kind=online&fr_type=online";
f.target="hiddenframe"
f.submit();
}
</script>
<?}?>
답변 1
http://vhost.kr/g5/js/owlcarousel/owl.carousel.min.css?ver=210618
에서
.owl-carousel .owl-item img {
- display: block;
- width: 100%;
}
width가 100%라서 그렇습니다.