我让用户通过单击一个按钮来创建图像和按钮(上面有图像的按钮):“new_a_window”,所以我append()
在 jQuery 中使用。但问题是当用户按下它时,我必须得到不同的图像。
当用户单击“new_a_window”按钮时,jQuery 将在 jDialog(story_pages) 中创建一个带有图像的按钮。
$( '#new_a_window').bind('click',function(){
$('#story_pages').append('<div><button value=window_value
style="width:100px; height:100px" >
<img id=window_value src="../pic/white.png" width="100px" height="100px">
</button></div>');
window_value= window_value+1; //I give each of the images a unique integer value since of
// the value is the index of a image array.
})
我必须实现这个场景: