Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-22-2008, 03:18 PM   PM User | #1
gentooX
New to the CF scene

 
Join Date: Oct 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
gentooX is an unknown quantity at this point
Javascript problem: Flash embed player plays in background in IE/Opera

You can see a working example here: http://www.mediamelon.com/MediaMelon/showcase.jsp Upon loading, let the flash player play. Then switch to some other option from the top navigation (orange lines on hover) while the video is playing.

The problem is that on IE and Opera the flash player plays in the background even after i switch to a different player by clicking on the options at the top. Its fine in Firefox/Safari.
Heres a code snippet:
Code:
/* This is the top navigation */
<ul>
<li id="wid1" onClick="expand('widget1','widget2','widget3','widget4');chgclass('wid1');return false">MediaMelon Player</li>
<li id="wid2" onClick="expand('widget2','widget3','widget1','widget4');chgclass('wid2');return false">MediaMelon Player with Ads</li>
<li id="wid3" onClick="expand('widget3','widget1','widget2','widget4');chgclass('wid3');return false">MediaMelon API</li>
<li id="wid4" onClick="expand('widget4','widget1','widget2','widget3');chgclass('wid4');return false">HD Widescreen Player</li>
</ul>

/* One of the flash embed players */
<div id="widget1" style="display:none;"><iframe width='320' height='250' scrolling='no' frameborder='0' src='http://www.mediamelon.com/MediaMelon/PartnerVideo.do?mediaid=1883'></iframe></div>
And the relevant javascript snippet is:
Code:
function divStat(id)
			{
				if(document.all)
				return document.all[id];
				else
				return document.getElementById(id);
			}
function expand(toggle1, toggle2, toggle3, toggle4)
	{
	   divStat(toggle1).style.display='none';
	   divStat(toggle2).style.display='none';
	   divStat(toggle3).style.display='none';
	   divStat(toggle4).style.display='none';
	   divStat(toggle1).style.display='block';
}
Making "display:none" for the div containing flash doesn't stop flash from running in the background even though the div changes.
How do i let the initial flash player (when the "MediaMelon API" option bar is orange in color) stop playing in background on Ie browsers when i choose some other option?

Thanks,

P.S. Dont bother about the other flash players which require installation of plugin. Just make sure that the "MediaMelon API" flash player is playing so that you can understand what the problem is.
gentooX is offline   Reply With Quote
Reply

Bookmarks

Tags
css, flash, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:39 AM.


Advertisement
Log in to turn off these ads.