首页
微语
统计
友链
留言
memos
圈子
图床
推荐
相册
网站监控
VPS监控
Search
1
为Typecho添加webp解析
37,824 阅读
2
实现typecho微信时光机功能的图文教程
31,370 阅读
3
emlog数据成功迁移到typecho
18,763 阅读
4
typecho 时光机单页 typecho-whisper
13,388 阅读
5
湖南移动5G特惠流量月包5元5GB/10元10GB
11,326 阅读
手机达人
免费资源
电脑网络
娱乐休闲
网站建设
威言威语
Typecho
Emlog
WordPress
服务器
主题
插件
排行榜    
登录
/
注册
Search
标签搜索
wordpress
发布
插件
免费
教程
typecho
EMlog
PHP
代码
CSS
华为
图片
代码修改
安装
评论
手机
诺基亚
微信
文章
智能
Chen'mo
累计撰写
1,265
篇文章
累计收到
367
条评论
首页
栏目
手机达人
免费资源
电脑网络
娱乐休闲
网站建设
威言威语
Typecho
Emlog
WordPress
服务器
主题
插件
页面
微语
统计
友链
留言
memos
推荐
相册
网站监控
VPS监控
搜索到
1
篇与
的结果
2013-02-08
Javascript+CSS控制日志图片大小
为了让文章的图片不撑破布局,找到了这个方法:以HotNews主题为例。打开HotNews主题HotNewspro\js目录的custom.js把下面代码加到最后:// 控制图片大小 $(document).ready(function() { var maxwidth=580; $(".entry p img").each(function(){ if (this.width > maxwidth) this.width = maxwidth; }); });再打开主题样式文件style在最后添加:.entry p img{ height: auto; } 也可单独使用Javascript或者CSS控制图片大小,不过兼容性较差javascrip:<script type="text/javascript"> $(document).ready(function() { var maxwidth=580; var maxheight=450 $(".entry p img").each(function(){ if (this.width > maxwidth) this.width = maxwidth; if (this.height > maxheight) this.height = maxheight; }); }); </script> CSS:.entry p img{ max-width: 90%; height: auto; } 其它主题可以将上述代码中的 .entry 改为所用主题选择器。来源:http://zmingcx.com/javascript-css-size-picture.html
2013年02月08日
648 阅读
0 评论
0 点赞