gpt4 book ai didi

jquery - IE中的CSS问题。 Jquery 图像/swf 交换

转载 作者:行者123 更新时间:2023-11-28 14:36:12 26 4
gpt4 key购买 nike

我有以下代码:

                <html>
<head>
<script type="text/javascript" language="javascript" src="jquery/jquery-1.5.1.js"></script>
<script type="text/javascript" language="javascript" src="http://jquery.thewikies.com/swfobject/jquery.swfobject.1-1-1.min.js"></script>
<style>
div#test{background:#ffffff;width:360px;height:360px;display:none;z-index:5;position: fixed;}
#mainimage{z-index:-1;}
</style>
</head>
<body>
<table border="1">
<tr>
<td><div id="test"></div>
<div id="mainimage"><img id="full_image" src="1.jpg" alt="0" width="360" height="360" border="0" /></div>
<span id="flash" style="width:360px;height:360px;border:0px;margin:0px;padding:0px;z-index:-1;">
<object data="fireworks.swf" type="application/x-shockwave-flash" id="flash_99458582" width="360" height="360">
<param name="movie" value="fireworks.swf"><param name="wmode" value="opaque">
</object>
</span>
</td>
<td>
<table>
<tr>
<td><a href="1.jpg" class="thumbnail"><img src="1.jpg" width="70" height="70"></a></td>
</tr>
<tr>
<td><a href="2.jpg" class="thumbnail"><img src="2.jpg" width="70" height="70"></a></td>
</tr>
<tr>
<td><img src="3.jpg" width="70" height="70" class="video"></td>
</tr>
</table>
</td>
</tr>
</table>
<br /><br />
<script type="text/javascript">
$(document).ready(function() {
$("#flash").hide();
$('a.thumbnail').click(function(){
var src = $(this).attr('href');

$("#test").fadeIn("slow", function () {
//$("#test").fadeOut("slow");
$("#flash").hide();
$("#test").hide();
$("img#full_image").show();
$("img#full_image").css({ opacity: 0 });
//alert(src);
if (src != $('img#full_image').attr('src').replace(/\?(.*)/,'')){
$('img#full_image').attr('src', src+'?'+Math.floor(Math.random()*(10*100)));
}

$('img#full_image').stop().animate({opacity: '1'}, 'slow');
});



//alert("here");
return false;
});
$('img.video').click(function(){
$("img#full_image").fadeOut("slow", function () {
$("#test").show();
$("#flash").show();
$("img#full_image").hide();
$("#test").fadeOut("slow");

});
return false;

});

});
</script>
</body>
</html>

这基本上有一些拇指,当您单击它时,它会作为主图像加载。单击时还有一个加载 swf 文件的缩略图。当加载主图像/swf 时,我也有淡入/淡出效果。这适用于 chrome 和 firefox,但是当我在 IE 中尝试时,由 jquery 加载的 div 将内容向下推送。谁能帮忙调试一下?

谢谢

最佳答案

您没有文档类型,因此您的页面正在使用 Quirks Mode .

在第一行添加 HTML5 文档类型:

<!DOCTYPE html>

我实际上并没有测试看这是否能解决您的问题,但可能性很大。

例如,您使用的 position: fixed 在 IE 的 Quirks 模式下不起作用。

关于jquery - IE中的CSS问题。 Jquery 图像/swf 交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6701361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com