1 頁 (共 1 頁)

自動縮圖外掛

發表於 : 2011-01-02 11:48
momm
想請問一下
自動縮圖外掛...
要如何才能調整縮圖大小阿

<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img');
if (im.width > 600)
{
im.style.width = '600px';
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}

</script>

程式碼如上...
我嘗試了改程式碼裡面的數字
以為就可以讓縮圖變大了
可是好像沒什麼用
感謝XD

●主機作業系統:Linux
●免費(或付費)空間連結: serverzoo.com
●您的 phpBB 版本:phpBB 3.0.6
●您的 domain (網域名稱) :mr-drunk.com
●您的 phpBB 連結網址: mr-drunk.com

Re: 自動縮圖外掛

發表於 : 2011-01-03 11:57
心靈捕手
建議您補充說明:
1. 外掛連結。
2. 您更新的代碼為何?

Re: 自動縮圖外掛

發表於 : 2011-01-03 12:24
yehrussell
您的 phpBB 版本:phpBB 3.0.6
建議大大,還是最好更新到最新版-->phpBB 3.0.8
比較安全喔 :-D

Re: 自動縮圖外掛

發表於 : 2011-01-06 19:53
momm
外掛連結:viewtopic.php?f=134&t=50324

我想把縮圖改大一點於是我把
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img');
if (im.width > 600) <------------------改成800
{
im.style.width = '600px'; <------------------改成800

eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400(改成六百),height=400(改成六百),scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}

</script>

Re: 自動縮圖外掛

發表於 : 2011-01-07 05:19
心靈捕手
momm 寫:外掛連結:viewtopic.php?f=134&t=50324

我想把縮圖改大一點於是我把
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img');
if (im.width > 600) <------------------改成800
{
im.style.width = '600px'; <------------------改成800

eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400(改成六百),height=400(改成六百),scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = '按此, 觀看完整大小的圖片';
}
}
}
}

</script>

隱約知道您的改法,只是不清楚您究竟儲存後的檔案內容。

建議您:
1.確認:是否在修改、存檔後,有清除論壇快取?
2.將您已經修改完的檔案,壓縮後,上傳到這裡。