473,781 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding embed objects in Safari ?

dd
Hi,

I have some code that hides all Flash objects on a page. It's working
fine on IE and Gecko but doesn't work on Safari. There are no errors
(shown in the console) when it runs on Safari, and when I alert the
properties they do show the correctly changed status, but the screen
doesn't reflect that. It maybe a bug in the Flash player for Safari
(I'm using player 9.0) which is just ignoring that it's been hidden.
Here is the Firefox/Safari part of my logic:

for(var i=0;i<document. embeds.length;i ++)
if(document.emb eds[i].type=="applica tion/x-shockwave-flash")
document.embeds[i].style.visibili ty="hidden";

If I alert the visibility beforehand, it's set to "visible" and
afterwards it's set to "hidden", so clearly the code is doing what's
asked of it, but still the Flash continues to persist on-screen. I
tried a browser resize (with the mouse manually) and it still remained,
so it wasn't just a bad rendering issue. The Flash remains there and
remains animating and interactive. I've considered resizing it to zero
x zero but that may have page alignment issues if that embed was
filling a hole.

Ideas anyone? That code above works on all non-IE browsers I've tried
it on. The IE version of course looks through the objects array and
checks the classid but when it comes to hiding, does the same thing.

Jan 12 '07 #1
3 2477
ASM
dd a écrit :
Hi,

I have some code that hides all Flash objects on a page. It's working
fine on IE and Gecko but doesn't work on Safari. There are no errors
(shown in the console) when it runs on Safari, and when I alert the
properties they do show the correctly changed status, but the screen
doesn't reflect that. It maybe a bug in the Flash player for Safari
(I'm using player 9.0) which is just ignoring that it's been hidden.
Here is the Firefox/Safari part of my logic:

for(var i=0;i<document. embeds.length;i ++)
if(document.emb eds[i].type=="applica tion/x-shockwave-flash")
document.embeds[i].style.visibili ty="hidden";
and trying something like :

var O = document.getEle mentsByTagName( 'EMBED');
for(var i=0;i<O.length; i++)
if(O[i].type=="applica tion/x-shockwave-flash")
document.body.r emoveChild(O[i]);

variante :

var O = document.getEle mentsByTagName( 'EMBED');
for(var i=0;i<O.length; i++)
if(O[i].type=="applica tion/x-shockwave-flash") {
var d = document.create Element('DIV');
d.width = O[i].width;
d.height = O[i].height;
d.style.width = O[i].style.width;
d.style.height = O[i].style.height;
d.className = O[i].className;
d.innerHTML = O[i].src;
document.body.r eplaceChild(d,O[i]);
}


--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #2
dd
Thanks ASM. I tried removeChild and Safari doesn't seem to like it
much. I would have pursued that but I just figured out this alternate
solution:

var obj_to_hide=doc ument.embeds[i];
if( Safari && obj_to_hide.par entElement.tagN ame=="OBJECT")
obj_to_hide=obj _to_hide.parent Element;

obj_to_hide.sty le.visibility=" hidden";

When it comes to hiding/showing, it's the parent object tag that should
be targeted.

Jan 12 '07 #3
ASM
dd a écrit :
it's the parent object tag that should
be targeted.
Je m'en doutais un peu.

It is certainly cleaner.

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Jan 12 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4499
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after that I've got confused. For example, what should be put into classid and codebase attributes of the OBJECT now embedding the EMBED tag?
6
1957
by: Timo | last post by:
I don't know enough about the technology yet to know whether this is a ridiculous question-- but is there no cross-browser javascript implementation of XMLHTTP and SOAP for use in calling web services? It looks as though MSFT expects the client to be running Windows and ActiveX and have certain DLLs installed; and Mozilla seems to have its own implementation of SOAP. Is it possible to implement these protocols in pure client-side...
3
2593
by: Xah Lee | last post by:
what's HTML 4 standard's equivalent of the following? <embed src="souls.mid" autostart="false" width="500" height="20"> thanks. Xah xah@xahlee.org ∑ http://xahlee.org/
6
538
by: harrylmh | last post by:
Hi, I'm learning C# and I just don't quite understand the need for polymorphism. why do we need to use it? how does a base class variable holding a derived class instance do any good? Also, what's the difference between method hiding and overriding when they're both still overriding the base method. Thanks
7
1643
by: Haines Brown | last post by:
I'm trying to use a Shockwave Flash file as is except for a line of text that it displays. I'd like to hide that line of text, and so I tried to create a black mask to do it. However, I can't move the mask over the text. This is the idea: <div id="inside"> <embed>...</embed> <div id="mask"></div>
2
1804
by: nyluke | last post by:
If I embed a movie (Quicktime or anything) in a DIV and then use javascript to change the innerHTML of that DIV, the movie keeps playing invisibly (I can hear the audio) after the change. This works in every browser except Safari. Anyone know a fix? Tx
25
2780
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as this application is heavily data-centric around MSDE database. Would it be better to use custom business objects or extend
9
18204
by: dd | last post by:
Does anyone have a cross-browser solution for hiding scrollbars and/or disabling scroll for the whole page? When the user clicks something, I want to display a DIV that fills the whole client area. While this DIV is displayed, they can close it by clicking the close button on the DIV. During the time this DIV is visible though, I don't want them to be able to scroll (and they usually can scroll because the page itself is typically...
3
3070
by: tn | last post by:
Hi, I have a test page at http://maroc.tribalnetworks.org/testmov.html I am trying to find a way to embed the video as simply as possible without specifying WMP or QuickTime player (or any particular plug- in). When I used "video/quicktime", of course it called the quicktime player, so I changed it to "video/mpeg" but this didn't seem to work in explorer. I tried first with the quicktime plug-in, and that
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9939
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4040
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.