我在嘗試從我的頁面上的多個圖像調用JQuery函數時遇到了一些麻煩。如果有人能幫助我,這將是偉大的。多個圖像點擊JQuery
這是我的代碼:
HTML
<input type="image" name="rateButton[1]" src="img/Rate1.png" height="40" width="40" value="1" onclick="rateBox(1)"/>
<input type="image" name="rateButton[2]" src="img/Rate2.png" height="40" width="40" value="1" onclick="rateBox(2)"/>
<input type="image" name="rateButton[3]" src="img/Rate3.png" height="40" width="40" value="1" onclick="rateBox(3)"/>
<input type="image" name="rateButton[4]" src="img/Rate4.png" height="40" width="40" value="1" onclick="rateBox(4)"/>
<input type="image" name="rateButton[5]" src="img/Rate5.png" height="40" width="40" value="1" onclick="rateBox(5)"/>
<input type="image" name="rateButton[6]" src="img/Rate6.png" height="40" width="40" value="1" onclick="rateBox(6)"/>
<input type="image" name="rateButton[7]" src="img/Rate7.png" height="40" width="40" value="1" onclick="rateBox(7)"/>
<input type="image" name="rateButton[8]" src="img/Rate8.png" height="40" width="40" value="1" onclick="rateBox(8)"/>
<input type="image" name="rateButton[9]" src="img/Rate9.png" height="40" width="40" value="1" onclick="rateBox(9)"/>
<input type="image" name="rateButton[10]" src="img/Rate10.png" height="40" width="40" value="1" onclick="rateBox(10)"/><br>
JQuery的
$(document).ready(function(){
function rateBox(rating){
// Ajax Call here...
}
});
要撥打rateBoxn上的任何圖像點擊/? – 2013-02-18 10:45:46