我被困在爲什麼這不起作用。 抓取可見的div
與.open
類,然後抓div
與類.edititable
並附加一個圖像。抓住可見的div附加圖像
請任何幫助將是偉大的。
這裏是我的代碼:
$('#imagefiles ul li img').click(function() {
//Get the source of the image that was clicked
var img = $(this).attr('src');
//grab the visible div and the div with class edititable within it and append image
$(".open:visible.edititable").append('<img src="' + img + '" style="width:30%; height:30%;" ">');
});
什麼是':visible'?我不認爲這是一個有效的選擇。 – Leeish 2013-02-28 21:47:11
@Leeish - 它是一個jQuery選擇器 – BenOfTheNorth 2013-02-28 21:47:43
我只是谷歌和我看到。有趣。應該是:'.open.edititable:visible'我敢打賭。 – Leeish 2013-02-28 21:48:26