Dedecms织梦手机站宽度width自适应实现了,但高度height自适应
发布时间:02/10 来源:未知 浏览:
关键词:
Dedecms手机站宽度width自适应实现了 。
最近我做一个手机站的时候出现了个自适应的问题
当手机站的加入
Markup
<meta name="viewport" content="width=device-width, initial-scale=1">
这段代码的时候自适应已经实现,可以自动扩大和缩小,但是文章页,的文章内容里的图片因为是后台添加的,后台会自动加上style=width:100px; heidht:80px;” 或者heidht=80”
测试自适应的时候宽度已经自动缩小,但是高度不变!显示错误的效果为:
下面是解决办法:
找到 include/arc.archives.class.php 用DW或者其他工具打开后
找到以下代码
3 |
$this->Fields[ 'typename' ] = $this->TypeLink->TypeInfos[ 'typename' ]; |
4 |
@SetSysEnv($this->Fields[ 'typeid' ],$this->Fields[ 'typename' ],$this->Fields[ 'id' ],$this->Fields[ 'title' ], 'archives' ); |
|
在这段代码下面添加:
3 |
$this->Fields[ 'body' ] = str_ireplace(array( 'alt=""' , 'alt=\'\'' ), '' ,$this->Fields[ 'body' ]); |
4 |
$this->Fields[ 'body' ] = preg_replace( "@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s]@isU" , " " ,$this->Fields[ 'body' ]); |
5 |
$this->Fields[ 'body' ] = str_ireplace( "<img " , "<img alt=\"" .$this->Fields[ 'title' ]. "\"" ,$this->Fields[ 'body' ]); |
7 |
$this->Fields[ 'body' ] = preg_replace( '/<img(.+?)height:(.+?) (.+?)">/i' ,"<img$1$3>",$this->Fields[ 'body' ]); |
8 |
$this->Fields[ 'body' ] = preg_replace( '/<img(.+?)height=(.+?) (.+?)>/i' , "<img$1$3>" ,$this->Fields[ 'body' ]);
|
|
|
打赏
打赏
扫码打赏,你说多少就多少
打开支付宝扫一扫,即可进行扫码打赏哦
百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!