jeffkee
jeffkee

Reputation: 5238

Using SWFObject, the flash moves 1 pixel to the right on Firefox

Please check this page: http://islandhideaway.weebly.com/ For whatever reason, the flash slideshow moves over 1 pixel when opened in Firefox on my Mac. All other browsers render it fine, but only on Firefox it leaves a 1 pixel white gap on the left!

I am using the most recent version of SWFObject. This unfortunately is a garbage Weebly site and I cannot use jQuery in the system so I can't do a real gallery... so let's save the whole "don't use Flash for that" pep talk. It's a favour for a friend and I am already aware of better ways to do it. :)

Upvotes: 2

Views: 1362

Answers (4)

davydka
davydka

Reputation: 73

You can also do something like:

div.flashContainer {position:relative; width:200px; left:50%; margin-left:-100px }

Replace the width value with your value and make the margin-left negative half that. Another standard way of centering something which avoids the margin:0 auto bug.

Upvotes: 0

jfrank
jfrank

Reputation: 733

I realize this question has already been answered, but I was googling for this problem today and came across this link. I used a javascript fix that seems to work very well. I found the original javascript in this Mozilla bug discussion, and then I modified it a bit.

https://bugzilla.mozilla.org/show_bug.cgi?id=550246

Here is the javascript that I ended up using (I hope it shows up properly in this post):

<script type="text/javascript">
var isFireFoxMac=false;
if (navigator.userAgent.indexOf("Firefox")!=-1) {
    if (navigator.platform == "MacIntel" || navigator.platform == "MacPPC") {
        isFireFoxMac = true;
    }
}
function isEven(value){
    return (value%2 == 0);
}
function ensureOddWidth() {
    var width = window.innerWidth;
    if (isEven(width)) {
      self.resizeTo(width-1, window.outerHeight);
    }
}
if (isFireFoxMac) {
    window.onresize = ensureOddWidth;
    window.onload = ensureOddWidth;
}
</script>

Upvotes: 0

tuomassalo
tuomassalo

Reputation: 9101

I had the same problem, and kc rajput's answer didn't help for me. (So this may be two distinct bugs.)

For me, the 1px offset bug occurred depending on whether the browser viewport width was an odd or even number of pixels. So, resizing the browser window just a bit made the problem go away or come back. The Flash object was in a horizontally centered element.

Anyway, this tweak helped for me. Basically I just added a border-left: 1px solid transparent; for the element that had margin-left: auto; margin-right: auto;.

Of course, if your centered element already contains a border, it won't be that simple.

Upvotes: 1

Kali Charan Rajput
Kali Charan Rajput

Reputation: 12596

you should use this in your object code

<param name="SCALE" value="exactfit" />

and for menu you should use transparent flash

<PARAM NAME=wmode VALUE=transparent> 

and find the embed and add this

wmode="transparent"

try this

Upvotes: 1

Related Questions