开发者

Is there a difference in how Firefox and IE handle jQuery CSS?

I'm working on these rich media ads for work and they worked in all browsers until I started playing with the jQuery css method. Nothing displays in IE, this wasn't a problem yesterday when I was at my meeting. The only thing I can possibly link it to is maybe IE handles css differently. Any help would be appreciated, here's a sample of my code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Molson Canadian Ad Template</title>

<style type="text/css">

body {
    background开发者_如何学JAVA-color: #333;
}

</style>

<script src="http://code.jquery.com/jquery-1.5.js"></script>
<script src="jquery.swfobject.1-1-1.min.js" type="text/javascript"></script>

<script>

$(document).ready(

    function() {

        jsReady = true;

        banner1 = $('#banner1');
        banner1.css({overflow:'hidden', position:'absolute', left:158});
        banner1.flash({swf: 'molson1_300x250.swf', width: 300, height: 250, play: true, flashvars: {message:'in'}});
    }
);

var jsReady = false;

function isReady() {

    return jsReady;
}

function sendToJavaScript(value) {

    if( value == "expand" ){

        banner1.css('left', 0 );
        banner1.flash().remove();
        banner1.flash({swf:'molson1_600x250.swf', width:600, height:250, wmode:"transparent"});

    }else{

        banner1.css('left', 158 );
        banner1.flash().remove();
        banner1.flash({swf: 'molson1_300x250.swf',width: 300,height: 250,play: true},function(){this.GotoFrame(71)});
    }
}

</script>

</head>

<body>
<div id="banner1"></div>
</body>
</html>


I figured it out guys, the problem I was having was that I would define a variable like so

banner1 = $('#banner1'); 

and then try to call methods like this

banner1.css(); 

this works fine in firefox, but in IE you have to call it like so

$('#banner1').css();


Is there a difference in how Firefox and IE handle jquery CSS?

Yes there is.

This knows ALL:

http://www.quirksmode.org/css/contents.html

1. IE 5/6 doesn’t implement overflow: visible correctly.
2. E 5/6 don’t support position: fixed
   IE7 has a strange bug; see page.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜