The ShareThis popup box is causing flash objects to disappear in Firefox 3 and IE7.

Steps to reproduce:
1. Create a new node (one that uses ShareThis)
2. Paste in HTML for a flash object (like an embedded YouTube video)
3. Submit the node
4. Click the ShareThis link on the node
5. The embedded flash object will disappear
6. Close the ShareThis popup
7. The embedded flash object will re-appear


This problem is not occurring in Safari 3 or Chrome 1.

Comments

WildBill’s picture

I believe this is by design? The social-bookmarking tools like AddThis and AddToAny generally do this by default, in order to avoid conflicts with Flash objects. They "hide" the Flash objects temporarily so that they don't interfere. I believe ShareThis does the same thing. At any rate, I think you can override it when creating the custom code at the STAPI.

spiffyd’s picture

In chrome, flash objects don't disappear, however, the sharethis box appears below the object so you can't use the links. Anyone have a solution? Tweak z-index in CSS?

Snipon’s picture

To spiffyd: The solution to that is the wmode="transparent" setting in the object or embed tag.

siharris’s picture

There is an option to allow other flash objects if you create your button code at sharethis.com.

dboulet’s picture

Version: 6.x-1.4 » 6.x-1.x-dev
Category: bug » feature

This is easy to fix in the stable version by inserting custom JavaScript code into the module settings. To generate the code, go to http://www.sharethis.com/publishers/getbutton and check 'Enable Embeds'.

Unfortunately the option to supply custom JavaScript has been removed from the dev version of this module, is this going to be re-introduced? If not, could we get an 'Enable Embeds' setting?

dboulet’s picture

Status: Active » Needs review
StatusFileSize
new1.64 KB

Patch provides an option on the settings page to show embeds while the iFrame is loaded.

spiffyd’s picture

Enabling embeds does not resolve the layer problem. YouTube embeds, for instance still show above the iframe. Any suggestions?

dboulet’s picture

@spiffyd See comment #3--you have to set the wmode for all your Flash movies to 'transparent' or 'opaque' to allow html elements to be layered over them. You might also have to set the z-index on all layered elements to get them to stack in the right order.

To set wmode for a YouTube Flash movie for example, replace the default code:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/whatever&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/whatever&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

with this:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/whatever&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/whatever&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" wmode="transparent" allowfullscreen="true" width="425" height="344"></embed></object>
spirkster’s picture

@dboulet (or anyone) -- what if I don't have access to the hardcode to change that param value of 'wmode'?

I want to override all Flash embeds/apps on a webpage with a 'wmode' parameter of 'opaque' ...... IF, the 'wmode' parameter currently is set to 'window'.

This gets somewhat nasty, because typically Flash ads are in IFRAMES.

Using JavaScript, do you think it's possible to somehow access the DOM, check all Flash apps that are running on a webpage (and all their IFRAMES that have loaded), then maybe create an array of them all, then go through each and check the 'wmode' variable for them, and if wmode= 'window', then override it with 'opaque'?

Here are some articles on the subject that I found: [google search: override flash wmode javascript]

http://www.dynamicdrive.com/forums/showthread.php?t=17858
(this article seems to suggest that you must have access to the Flash embed code and need to add the param 'wmode' hardcoded; otherwise you raise the 'z-index' value of everything on the page and hope they all go over the banner [although I wonder if a bgimage might then go over the banner?])

http://www.c6software.com/Products/PopBox/Faq.aspx#flash2

http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-conten...

Thanks,
Steve
http://blog.stevepoland.com/about

spirkster’s picture

ok not sounding good.. from a buddy of mine:

I have some experience dealing with this already. The Flash player's normal behavior is to draw itself over top of the browser window. It doesn't parse the HTML or CSS or anything, it just knows where to draw, how wide, and how tall. Flash player is it's own app, so in windows it gets it's own window messages and everything, just like the browser or any other windows app. Then came along the 'wmode' parameter to help things out a bit. It forces the flash app to act as a layer in the page. My details might be a little fuzzy but that's how it works in general.

Here's the kicker: The Flash player checks and adheres to the wmode parameter upon initialization only. Remember, it's a program. It's not written to constantly monitor the wmode parameter and change modes. It checks it once and that's how it runs. This means while you can change it using JavaScript, it does nothing. I actually tried that already with the popup survey, cycling through each embed object and changing the wmode to transparent. The parameter changed, as was visible using Firebug, but the flash app didn't change modes.

dboulet’s picture

Yeah, I don't think that there's much you can do if you don't have the ability to change the source code, especially if it's in an iframe. In that case it's probably better to just use the default behavior of hiding Flash movies when the ShareThis popup is displayed.

selvakan’s picture

Hi,

Why cant use Addthis instead of Sharethis which creates lot of problems??

With Sharethis you always need to face the following problems,
1) Sharethis pop-up will not work in IE6, also sharethis support team also closed the official support in this.
2) Sharethis slows down you page loading time
3) ShareThis Window will hiding Flash object in Firefox. So you better go for "Addthis".

See working example : http://www.chennai-directory.com/

dboulet’s picture

@selvakan There is another module for that: http://drupal.org/project/addthis.

robloach’s picture

Status: Needs review » Closed (fixed)

Anon is a hero. Please see #619964: Javascript errors on IE, FF, Safari as his fix was committed and update to ShareThis 6.x-1.7.

dboulet’s picture

Status: Closed (fixed) » Needs work

Sorry, I don't understand why this issue was closed. The issue referred to in #14 doesn't seem to be related to this issue.

dboulet’s picture

Status: Needs work » Fixed

Alright, I was able to fix the problem by putting this in the "Code" textarea in the module configuration page:

http://w.sharethis.com/button/sharethis.js#ref=jquery&amp;embeds=true

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.