因此,在我使用 javascript 为一些 img 或 div 设置动画后,它们不再具有可用的单击或悬停事件。(有问题的imgs是在“n”后面排列后的4个大气泡)
我确定这是一个常见的问题,我只是找不到答案。提前致谢!
实时代码:http: //jboullion.com/nebuloid/index.html
这是我的 html div 的 3 种不同变体
<div >
<a href="javascript:link()"> <img id="bubbleOne" alt="Staff" src="images/smallbubble.png" /></a><br />
</div>
<div>
<img id="bubbleTwo" onclick="link()" alt="Mission" src="images/smallbubble.png" /><br />
</div>
<div>
<img id="bubbleThree" href="javascript:link()" alt="Games" src="images/smallbubble.png" /><br />
</div>
这是我的 javascript - 简要版本
$("#bubbleOne").click(function(event)
{
fadeLogo()
if (iOS == true) {
window.scroll(0,350);
}
$("#copy").html("<span id='purp'>WE ARE NEBULOID</span> <br/><br/>We want to make great video games.<br/> We want to stretch the boundaries that define what video gaming looks and feels like.<br/> We are new developers cutting our teeth, and we have very grand and exciting projects coming soon.<br/> Our biggest upcoming project is a subtle, human, and epic science fiction adventure.");
$("#mission").css("color","#8470FF");
colorHoldM = "#8470FF";
colorHoldG = "white";
colorHoldS = "white";
colorHoldC = "white";
$("#games").css("color","white");
$("#staff").css("color","white");
$("#contact").css("color","white");
});
$("#bubbleOne").hover(function(){
$("#bubbleOne").animate({
width: "175px"}, 500 );
});
$("#bubbleOne").mouseout(function(){
$("#bubbleOne").animate({
width: "110px"}, 500 );
});
function fadeLogo()
{
//stuff
$('#bubbleOne').delay(1000).animate({left: '+=120', top: '-=130' }, 1000);
$('#bubbleTwo').delay(1000).animate({left: '-=50', top: '-=130' }, 1500);
$('#bubbleThree').delay(1000).animate({left: '-=230', top: '-=165' }, 2000);
//stuff
}
有人知道答案吗?