css - Opacity IE 8 Fallback with jQuery -
i have gone through post:
set opacity javascript in ie 8?
this purely done javascript, using jquery want set opacity in ie8 not getting succeed using jquery.
so far doing this:
$('.set').click(function (e) { var hiddensection = $('div.hidden'); hiddensection.fadein() .css({ 'display': 'block' }) .css({ width: $(window).width() + 'px', height: $(window).height() + 'px' }) .css({ top: ($(window).height() - hiddensection.height()) / 2 + 'px', left: ($(window).width() - hiddensection.width()) / 2 + 'px'}) .css({ 'background-color': 'rgb(190,190,190)'}) //here bgcolor .css({ 'filter': 'alpha(opacity=1000)' }) // here opacity .appendto('body'); $('span.close').click(function () { $(hiddensection).fadeout(); }); });
is there anyway achieve css opacity in ie 8, know ie8 doesn't support opacity, post mentioned gets done in ie 8 also.
this sentence .css({ 'filter': 'alpha(opacity=**val**)' })
might have break.
how can working in ie 8?
note:
please avoid rgba()
know doesn't work ie 8
any appreciated.
try this:
/* ie 8 */ -ms-filter: "progid:dximagetransform.microsoft.alpha(opacity=50)"; /* ie 5-7 */ filter: alpha(opacity=50);
so in case:
.css({ '-ms-filter': 'progid:dximagetransform.microsoft.alpha(opacity=**val**)' })
the filter opacity value can integer between 0 , 100.
read more here.
Comments
Post a Comment