javascript - How do I programmatically set all <object>'s to have the wmode set to opaque? -
I have a client who is embedding the video into my WordPress blog The problem is that they have a large CSS dropdown That hides behind the flash video. I understand that setting the video's wmode as opaque will fix it, but I need it to clearly apply it to every uploaded video and need to go to HTML to add this tag No
Is there any way I can programmatically?
To avoid confusion with all the edits I made in my previous answer, New test with test and working sample page This test has been done and is working in IE 6, 7 and; 8, Opera 9.6 & amp; 10, Safari 3 & amp; 4, Google Chrome, but I did not test any version of Firefox (2, 3 or 3.5):
& lt; Html & gt; & Lt; Head & gt; & Lt; Title & gt; Opacity Text XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX & lt; Br> & Lt; / Div & gt; & Lt; Object class = "clayed: D27CDB6E-AE6D-11cf-96B8-444553540000" height = "200" width = "300" & gt; & Lt; Param name = "movie" value = "http://freevideocoding.com/flvplayer.swf?file=http://www.freevideoediting.com/TVQvideos/Queen demo - flv.flv and autostart = false" & gt; & Lt; Param name = "bgcolor" value = "# ffff00" & gt; & Lt; / Object & gt; & Lt ;! - You need to do this work below. The script is below; Everything else is a sample code just to provide a sample which the script shown below actually works - & gt; & Lt; Script type = "text / javascript" & gt; Function makeObjectsOpaque_TestedAndWorking () {var elementToAppend = document.createElement ('param'); ElementToAppend.setAttribute ('name', 'wmode'); ElementToAppend.setAttribute ('value', 'opaque'); Var Objects = document.getElementsByTagName ('Object'); (Var i = 0; i & lt; Objects lamps; i ++) for {var newObject = objects [i] .cloneNode (true); ElementToAppend = elementToAppend.cloneNode (true); NewObject.appendChild (elementToAppend); Objects [ii]. ParentNode.replaceChild (new object, object [i]); }} Window.onload = makeObjectsOpaque_TestedAndWorking; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Comments
Post a Comment