Javascript IE 9在子元素上有不透明度,我无法使用captify阻止它
好的,我正在使用一个名为Captify的javascript。它会在图像中添加一个小弹出窗口,其中包含文本。适用于所有接受IE9的浏览器。IE9会淡出弹出分区中的所有内容。我已经读到它是一个子元素问题,但我无法修复它。由于captify在网上任何地方都找不到了,我将在下面的css中包含所有的代码,然后在我的页面上添加代码。如果有人能帮我阻止这种衰退,我会非常感激,因为它给我带来了很多问题 爪哇 现在我的页面Javascript IE 9在子元素上有不透明度,我无法使用captify阻止它,javascript,jquery,html,css,Javascript,Jquery,Html,Css,好的,我正在使用一个名为Captify的javascript。它会在图像中添加一个小弹出窗口,其中包含文本。适用于所有接受IE9的浏览器。IE9会淡出弹出分区中的所有内容。我已经读到它是一个子元素问题,但我无法修复它。由于captify在网上任何地方都找不到了,我将在下面的css中包含所有的代码,然后在我的页面上添加代码。如果有人能帮我阻止这种衰退,我会非常感激,因为它给我带来了很多问题 爪哇 现在我的页面 <link href="/js/captify/sample.css" rel="
<link href="/js/captify/sample.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="/js/captify/captify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('img.captify').captify({
// all of these options are... optional
// ---
// speed of the mouseover effect
speedOver: 150,
// speed of the mouseout effect
speedOut: 200,
// how long to delay the hiding of the caption after mouseout (ms)
hideDelay: 100,
// 'fade' or 'slide'
animation: 'fade',
// text/html to be placed at the beginning of every caption
prefix: '',
// the name of the CSS class to apply to the caption box
className: 'caption'
});
});
</script>
<div id="services">
<ul >
<li >
<img src="/images/sports.png" width="169" height="121" class="captify" rel="caption1" />
<div id="caption1"><h4>Watersports</h4>
<p>View all the sports we offer on the lakeside.</p></div>
</li></ul></div>
既然IE不透明度处理很糟糕,我建议你们一起放弃。对于背景,可以使用透明png(1x1重复)来获得相同的效果。或者,如果您使用的是仅限IE的css,则可以定义背景以仅限IE使用png。我认为这将为你节省大量的时间来解决这个问题
编辑:当然别忘了在IE css中将不透明度设置为1,我知道这个问题很老了,但有人可能会发现这个问题很有用: 我在我的网页上这样做
$('img.captify').captify({
animation: 'always-on',
opacity: '0.7'
});
$('div.caption-bottom').wrapInner('<span class="caption-text"></span>');
@马克·金
谢谢,这对我有用
但是我把绝对改成了相对
.caption-text{
display:block;
position:relative;
}
我为此设置了一个新的工具,以防其他人也使用它。我会小心使用它,尽管在IE 9中它看起来很糟糕。你不能读课文
#services {
width: 570px;
margin-top: 370px;
height: 130px;
}
#services ul li {
float: left;
height: 128px;
width: 184px;
margin-right: 5px;
}
$('img.captify').captify({
animation: 'always-on',
opacity: '0.7'
});
$('div.caption-bottom').wrapInner('<span class="caption-text"></span>');
.caption-text{position:absolute;}
.caption-text{
display:block;
position:relative;
}