[BBCODE][image]可设置图片尺寸的标签

回复
头像
523066680
Administrator
Administrator
帖子: 573
注册时间: 2016年07月19日 12:14
联系:

[BBCODE][image]可设置图片尺寸的标签

帖子 523066680 »

添加可设定图片尺寸的BBCode
https://www.phpbb.com/community/viewtop ... &t=2105534

TOM 写了:

代码: 全选

[fimg={NUMBER1},{NUMBER2}]{URL}[/fimg]

代码: 全选

<img src="{URL}" style="width: {NUMBER1}px;height: {NUMBER2}px;" />

代码: 全选

Image with specified dimensions: [fimg=width,height]ImageURL[/fimg]
example

代码: 全选

[fimg=400,150]http://www.mysite.com/my_image.jpg[/fimg]
Sniper_E 写了: You could also use [image= or anything else. Setting just a width might be a thought, without the height.
Using just a width, the height will be proportional to the actual image size.
Visa versa too if you used just the height.

Like this with one number for the width...

代码: 全选

[image={NUMBER}]{URL}[/image]
And if you had highslide installed you could even use it's classes in your html replacement.

代码: 全选

<a href="{URL}" class="highslide" onclick="return hs.expand(this)"><img src="{URL}" width="{NUMBER}"  alt="" /></a>
Then by linking to a large image and selecting 200px for it's width in your post...

代码: 全选

[image=200]http://somesite.com/images/very_large_image.png[/image]
The image will be 200px wide in your page and popup with a large highslide view when clicked.
Just an additional option...
头像
523066680
Administrator
Administrator
帖子: 573
注册时间: 2016年07月19日 12:14
联系:

2023-11调整 Re: [BBCODE][image]可设置图片尺寸的标签

帖子 523066680 »

改为百分比缩放,这样写入一个值即可

代码: 全选

[Image={NUMBER}]{URL}[/Image]

代码: 全选

<img src="{URL}" style="width: {NUMBER}%; height: {NUMBER}%;" />
回复

在线用户

正浏览此版面之用户: 没有注册用户 和 0 访客