0

我无法弄清楚为什么使用 jquery-1.3.2.min.js 动画图像不会出现在 Chrome 中。如果使用 jquery-1.9.1.js,它不会出现在 IE 或 Chrome 中。我正在使用 HTML、css、js。我清除了 Chrome/IE 中的缓存,但这并没有什么不同。还尝试了此论坛中的建议,如下所述,但不适用于此问题。

<html>
<head>
<title>left.html</title>
<link rel="stylesheet" type="text/css" href="css/animate.css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/animatea.js"></script>
</head>
<body>
<div id="mask">
<div><img id="logo" border="0" src="logo.jpg"></div>  
<div id="subtitle">subtitle</div></div>
</body>
</html>

#mask{  
position:relative;  
/*margin-left: 10px;*/  
width: 400px;  
height: 100px;  
border: 0px solid grey;  
}  
#logo{  
float: right;  /*Tried w/o but made no difference*/ 
margin-left: 100%;  /*Tried different values but makes no difference*/
position: absolute; /*Tried fixed/relative but made no difference*/ 
z-index: 1;  
display: none; /*Tried w/o but made no difference*/ 
}  
#subtitle{
float: right; /*Tried w/o but made no difference*/ 
font-size: 0px;
font-family: verdana;
margin-left: 100%;
position: absolute;
z-index:2; /*Tried different number but made no difference*/
}

$(function(){  
//$('#lat1').click(function(){  
var l = $('#logo').width();  
var t = $('#logo').height();  
var speed = 800;  
$('#logo').css({width:0,height:0,display:''});  
moveIt(t,l,s,speed,0);  
});  
function moveIt(a,b,c,d,e){
$('#logo').animate({height:a,width:b,marginLeft:e},d);
aa = a-5;
$('#subtitle').animate({marginTop:aa,marginLeft:e,'fontSize':c},d,function(){
//setTimeout(function(){getBack(a,b,d);a=null,b=null,c=null},500);
});
$('#lat1').hide();
}
4

1 回答 1

0

尝试将您的img元素更改为 haveid="logo"而不是id="title". 您的 CSS 样式和 JS 都引用了一个元素#logo,但您没有具有该 ID 的元素。

编辑:moveIt()直到发布上述内容后,我才看到您添加该功能的更新。我现在看到您的moveIt()函数实际使用#title了 - 您需要使其与其他代码一致。(您还在#subtitle为未显示的元素设置动画?)

另外,我不确定使用#logoasfloat:right position:absolute- 尝试没有float.

于 2013-02-09T22:28:16.477 回答