久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區

標題: discuz手機版詳情頁,圖片自動固定大小,怎么修改? [打印本頁]

作者: chen-johnso    時間: 2019-7-11 19:41
標題: discuz手機版詳情頁,圖片自動固定大小,怎么修改?
本帖最后由 chen-johnso 于 2019-7-11 19:42 編輯

discuz手機版詳情頁,圖片自動固定大小,怎么修改?默認不能全屏,固定了尺寸,可是我在源碼里面,搜索不到這個數值。
(, 下載次數: 55)
作者: 建筑資源吧    時間: 2019-7-11 20:48
觸屏版圖片尺寸設置,打開\template\default\touch\forum\discuzcode.htm文件,找

  1. $fix = count($post[imagelist]) == 1 ? 140 : 83;
復制代碼
改為
  1. $fix = count($post[imagelist]) == 1 ? 650 : 800;
復制代碼
也就是把140的小圖改為寬650高800這樣,差不多是最大屏幕的手機的實際尺寸。這里建議電腦版的圖片上傳時就設置最大寬度不超過700,不然加載速度會很慢。然后再找
  1. $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 140, 140, 'fixnone') : '' ;
復制代碼
改為
  1. $mobilethumburl = $attach['attachimg'] && $_G['setting']['showimages'] && (!$attach['price'] || $attach['payed']) && ($_G['group']['allowgetimage'] || $_G['uid'] == $attach['uid']) ? getforumimg($attach['aid'], 0, 650, 800, 'fixnone') : '' ;
復制代碼


CSS設置,打開\static\image\mobile\style.css,找

  1. .plc .pi .message img,.plc .pi .img_one img { margin:0px 4px 0px 0; max-width:140px; max-height:140px; }
復制代碼

改為

  1. .plc .pi .message img,.plc .pi .img_one img {max-width:98%; display:block;vertical-align: middle;margin-bottom:4px;}
復制代碼

CSS也限制了高和寬,改為按屏幕尺寸的百分比來顯示。為了不撐破,別搞100%了,98%就足夠了。


作者: neol    時間: 2019-7-13 10:03
建筑資源吧 發表于 2019-7-11 20:48
觸屏版圖片尺寸設置,打開\template\default\touch\forum\discuzcode.htm文件,找

改為

贊一個!





歡迎光臨 Discuz! 官方交流社區 (http://www.9999xn.com/) Powered by Discuz! W1.0