1 頁 (共 2 頁)

[問題] 一句簡單的圖片連結語法 已明白, 謝各大相助!!

發表於 : 2006-03-09 21:35
kkt
今天想著美化一下版面的 icon , 而我一向用下面這語法都成功的.


成功的語法:
<img src="templates/subSilver/photo/ds.gif" alt="顯示更多表情符號類別"VALUE="{L_ALL_SMILIES}" ONCLICK="openAllSmiles();"/>
但同在快速回覆版面的兩個 icon [預覽] 和 [送出] , icon 是顯示了,
可怎麼搞都點擊沒有反應, 又是那裡錯了呢?

如圖:

圖檔

同樣的語法在 quick_reply.tpl 修改後:
<tr>
<td class='catBottom' align='center' height='28' colspan='2'>
<input type='hidden' name='mode' value='reply'>
<input type='hidden' name='t' value='{quick_reply.TOPIC_ID}'>
<input type='hidden' name='last_msg' value='{quick_reply.LAST_MESSAGE}'>
<!--input type='hidden' name='message' value=''-->
<img src="templates/subSilver/photo/pv.gif" alt="預覽文章" value='{L_PREVIEW}'/>&nbsp;
<img src="templates/subSilver/photo/sd.gif" alt="送出文章" value='{L_SUBMIT}'/>
</td>
</tr>
</table>
</form>
<!-- END quick_reply -->
修改前:
<tr>
<td class='catBottom' align='center' height='28' colspan='2'>
<input type='hidden' name='mode' value='reply'>
<input type='hidden' name='t' value='{quick_reply.TOPIC_ID}'>
<input type='hidden' name='last_msg' value='{quick_reply.LAST_MESSAGE}'>
<!--input type='hidden' name='message' value=''-->
<input type='submit' name='preview' class='liteoption' value='{L_PREVIEW}'>&nbsp;
<input type='submit' name='post' class='mainoption' value='{L_SUBMIT}'>
</td>
</tr>
</table>
</form>
<!-- END quick_reply -->

請問這段語法有問題嗎?


.

發表於 : 2006-03-10 02:26
ethan
要以圖片取代 button 時
<input type='submit' ....
改為
<input type=image border=0 src="yourbuttonimg.gif" ...

發表於 : 2006-03-10 03:37
kkt
ethan, 多謝您啊!! 我學您的語法, 但兩個按鈕點擊都變為預覽, 送出也是預覧?
且預覽的版面沒有之前的文字, 是空白的.
可能跟 css 檔有關. thx.....
<input type=image border=0 src="templates/subSilver/photo/pv.gif" alt="預覽文章" value='{L_PREVIEW}'/>&nbsp;
<input type=image border=0 src="templates/subSilver/photo/sd.gif" alt="送出文章" value='{L_SUBMIT}'/>


.

.....

發表於 : 2006-03-10 06:00
jwxie
阿k...
是在template裡的 posting_body.tpl嗎?

Re: .....

發表於 : 2006-03-10 08:15
kkt
jwxie 寫:阿k...
是在template裡的 posting_body.tpl嗎?
不錯, 要改的是 2 個, 另一個是 quick_reply.tpl

其實正如上圖, 是顯示了gif 的 icon, 衹不過不能正常送出或預覧.
另一方法是不改這 2 個 file, 直接在css 內寫入陰影美化. 像小c 那樣做.





.

發表於 : 2006-03-10 17:36
*tytsim*
為什麼你不用css的class
用了便只用改一個檔,
其他都不用改,
適合我那麼懶的人^v^

發表於 : 2006-03-10 18:57
kkt
*tytsim* 寫:為什麼你不用css的class
用了便只用改一個檔,
其他都不用改,
適合我那麼懶的人^v^
請教一下, css 一修改是全部按鈕吧 ?
我是自制風格按鈕, 每一個要獨立給它路徑..其實語法又沒錯, 就是那 2 顆不行.
怪怪的, 其他全部都可以這才有點怪!? :-|




.

發表於 : 2006-03-10 21:16
*tytsim*
那用class

發表於 : 2006-03-10 22:13
御津闇慈
kkt 寫:ethan, 多謝您啊!! 我學您的語法, 但兩個按鈕點擊都變為預覽, 送出也是預覧?
且預覽的版面沒有之前的文字, 是空白的.
可能跟 css 檔有關. thx.....
<input type=image border=0 src="templates/subSilver/photo/pv.gif" alt="預覽文章" value='{L_PREVIEW}'/>&nbsp;
<input type=image border=0 src="templates/subSilver/photo/sd.gif" alt="送出文章" value='{L_SUBMIT}'/>




.
這樣看看

代碼: 選擇全部

<input type=image border=0 src="templates/subSilver/photo/pv.gif" alt="預覽文章" name='preview' value='{L_PREVIEW}'/>&nbsp; 
<input type=image border=0 src="templates/subSilver/photo/sd.gif" alt="送出文章" name='post' value='{L_SUBMIT}'/> 

發表於 : 2006-03-11 00:51
kkt
多謝御津闇慈大大指導, 也多謝各大大賜教.
這樣看看

<input type=image border=0 src="templates/subSilver/photo/pv.gif" alt="預覽文章" name='preview' value='{L_PREVIEW}'/>&nbsp;
<input type=image border=0 src="templates/subSilver/photo/sd.gif" alt="送出文章" name='post' value='{L_SUBMIT}'/>
御大這語法仍然是成功顯示, 但按下去預覧變了空白, 之前輸入的文章沒有了,
而送出按鈕變為預覧, 也是空白. (同上)

算了, 其實也不重要, 衹是有點納悶, 像活見鬼的..><..其實語法是簡單,
參考一下其他按鈕連結也很多, 可就衹有這兩顆不行. :-|

但我用回原來的文字按鈕, 放那裡都沒問題, 衹是樣子難看一點而已, 如圖:

圖檔




.

發表於 : 2006-03-11 01:25
御津闇慈
kkt 寫:多謝御津闇慈大大指導, 也多謝各大大賜教.
這樣看看

<input type=image border=0 src="templates/subSilver/photo/pv.gif" alt="預覽文章" name='preview' value='{L_PREVIEW}'/>&nbsp;
<input type=image border=0 src="templates/subSilver/photo/sd.gif" alt="送出文章" name='post' value='{L_SUBMIT}'/>
御大這語法仍然是成功顯示, 但按下去預覧變了空白, 之前輸入的文章沒有了,
而送出按鈕變為預覧, 也是空白. (同上)

算了, 其實也不重要, 衹是有點納悶, 像活見鬼的..><..其實語法是簡單,
參考一下其他按鈕連結也很多, 可就衹有這兩顆不行. :-|

但我用回原來的文字按鈕, 放那裡都沒問題, 衹是樣子難看一點而已, 如圖:

圖檔




.
因為你的標籤屬性是image而不是submit
所以才會出現空白的問題

發表於 : 2006-03-11 02:49
~倉木麻衣~
我用subSilver來做示範
#
#--------[ OPEN ]----------------
#
templates/subSilver/posting_body.tpl

#
#--------[ FIND ]----------------
#

代碼: 選擇全部

<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" />
#
#--------[ REPLACE WITH ]----------------
#
<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" style="visibility:hidden;display:none" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" style="visibility:hidden;display:none" />
<image border=0 src="templates/subSilver/photo/pv.gif" alt="{L_PREVIEW}" onClick="document.getElementsByName('preview')[0].click()"/>&nbsp;
<image border=0 src="templates/subSilver/photo/pv.gif" alt="{L_SUBMIT}" onClick="document.getElementsByName('post')[1].click()"/>&nbsp;
#
#--------[ SAVE/CLOSE FILE]----------------
#
# EoM

藍字的部份是將原本的預覽及送出鈕隱藏起來並取消保留它的顯示位置
然後在底下加入兩個img標籤, 利用onClick去按下原本的預覽及送出鈕
以上程式在IE6及Firefox 1.5.0.1版上都正常運作

發表於 : 2006-03-11 05:04
jwxie

代碼: 選擇全部

onClick="document.getElementsByName('preview')[0].click()"
請教倉大, 你這個語法是 onClick = 指定的嗎?
還是onClick有其他的 =" "指派?

發表於 : 2006-03-11 05:36
kkt
~倉木麻衣~大大, 成功了!! 佩服!!

我加了一個 style="cursor: HAND" 顯示手型, 這樣感覺上比較會像連結.

quick_reply 快速回覆的版面按鈕. 如圖:

圖檔

也可看看實際效果 http://www.kktfriend.com/phpBB2/viewtopic.php?t=4962

下面的按鈕大家也可下載依樣修改

===============================================



圖檔 圖檔 圖檔 圖檔


這一顆可自行加字及調整大小便可
圖檔


===============================================

打開 quick_reply.tpl (快速回覆 Advanced_Quick_Reply_1.1.1)

找到:
<input type='submit' name='preview' class='liteoption' value='{L_PREVIEW}'>&nbsp;
<input type='submit' name='post' class='mainoption' value='{L_SUBMIT}'>
覆蓋為:
<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" style="visibility:hidden;display:none" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" style="visibility:hidden;display:none" />
<image border=0 src="templates/subSilver/photo/pv.gif" alt="{L_PREVIEW}" style="cursor: HAND"onClick="document.getElementsByName('preview')[0].click()"/>&nbsp;
<image border=0 src="templates/subSilver/photo/sd.gif" alt="{L_SUBMIT}" style="cursor: HAND"onClick="document.getElementsByName('post')[1].click()"/>
把圖片上傳到你自定的路徑 (紅字地方是圖片路徑)

完成

ps.請備份你的文件資料. 這修改是覆蓋原有按鈕位置, 其他位置請自行設定.



.

發表於 : 2006-03-11 11:21
~倉木麻衣~
jwxie 寫:

代碼: 選擇全部

onClick="document.getElementsByName('preview')[0].click()"
請教倉大, 你這個語法是 onClick = 指定的嗎?
還是onClick有其他的 =" "指派?
onClick是一個事件(event), 當這個事件被觸發時(trigger)就會去執行它所指定的事件處理函式(就是等號=裡的那一串)