Internet Explorer 7 8:jQuery UI效果只能使用一次 [英] Internet Explorer 7 8 : jQuery UI effects work only once
问题描述
Context
我使用jQuery UI效果( 以下代码适用于Chrome,Firefox和IE 9。 在IE 7和8上,我只能打开和关闭幻灯片一次。 slide
和 drop $
1.8.0
/ 1.8.1
1.8.23
代码+ JSFiddle
//打开幻灯片
$('a [data-toggle =slide]')。click(function(e){
e.preventDefault();
currentSlide = $(this).attr 'href');
$(currentSlide).show('slide',{direction:'right'},_config.effectDuration);
$('div.modal-backdrop' ).fadeIn(_config.effectDuration);
});
//关闭当前幻灯片
$('div.modal-backdrop,button.close')。click(function(){
$(currentSlide).hide 'drop',{direction:'right'},_config.effectDuration);
$('div.modal-backdrop')。fadeOut(_config.effectDuration);
});
滑块的内联样式它显示)在IE8(IE9兼容模式)中是以下内容:
zoom:1;过滤器:alpha(不透明度= 0);显示:块;
这意味着它是将不透明度设置为0的过滤器,这是罪魁祸首。
Context
I use jQuery UI effects (slide
and drop
) to open and close a slide.
The following code works on Chrome, Firefox and IE 9.
On IE 7 and 8, I can open and close the slide only once. After the slide stays hidden.
Any idea to resolve that?
- jQuery :
1.8.0
/1.8.1
- jQuery UI :
1.8.23
Code + JSFiddle
// Opens a slide
$('a[data-toggle="slide"]').click(function (e) {
e.preventDefault();
currentSlide = $(this).attr('href');
$(currentSlide).show('slide', { direction: 'right' }, _config.effectDuration);
$('div.modal-backdrop').fadeIn(_config.effectDuration);
});
// Closes the current slide
$('div.modal-backdrop, button.close').click(function () {
$(currentSlide).hide('drop', { direction: 'right' }, _config.effectDuration);
$('div.modal-backdrop').fadeOut(_config.effectDuration);
});
The inline style of the slider (on the second time it shows) is the following in IE8 (compatible mode from IE9):
zoom: 1; filter: alpha(opacity=0); display: block;
Which means that it's the filter that sets the opacity to 0 that is the culprit.
这篇关于Internet Explorer 7 8:jQuery UI效果只能使用一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!