我只是將其添加到內部html文檔中。所以它只想讓這個特定的物品活10秒。其他人就像它一樣,因爲他們代表不同的聊天泡泡。爲什麼這個淡出不起作用?
function placeChatBubbleOnScreen(message){
var chatBubble = "<div class= 'glass' onshow = '$(this).fadeOut(1000);'><p class= 'chat'>" + message + "<p></div>";
//<img class = 'speechBubble' src = '../images/GibberChatBubble.png'/>
document.getElementById("MenuBackground").innerHTML += chatBubble;
}
請提供一個[mcve] –
你需要更多的代碼。 – thatOneGuy
這是我的整個功能,它的工作原理,但onshow jquery方法不起作用 –