To condition something in jquery for IE7, I read here it's best to use this in the <HEAD>
:
<!--[if IE 7]> <html class="ie7"> <![endif]-->
Now, out of the following code,
I want transition: "elastic",
to be there only if it's ie7:
$(document).ready(function() {
$(".cbox").click(function(e) {
e.preventDefault();
$.colorbox({
transition: "elastic",
overlayClose: false,
opacity: 0.8,
});
return false
})
});
So I tried doing something like:
$(document).ready(function() {
$(".cbox").click(function(e) {
e.preventDefault();
$.colorbox({
if ($('html').hasClass('ie7') {transition: "elastic",}
overlayClose: false,
opacity: 0.8,
});
return false
})
});
But it's not the way to do this I guess... how should this be done?