Jump to content

Why wont my layers display....


iPixel

Recommended Posts

I've been staring at this and cant see why my layers  (layer1 & layer2) refuse to display.

 

The script checks for flash plugin... and depending on the plugin it choses which layer to display.

 

<html>
<head>
<title>FLASH DETECTOR</title>
<style type="text/css">
#layer1 /* FLASH LAYER */
{
display:none;
}
#layer2 /* STATIC LAYER */
{
display:none;
}
</style>
<SCRIPT LANGUAGE=JavaScript1.1>
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
	if (isNaN(parseInt(words[i])))
	continue;
	var MM_PluginVersion = words[i]; 
    }
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
document.getElementById('layer1').display="block";	// FAILS HERE
alert("Layer 1 Showing");
} else{
document.getElementById('layer2').display="block";
alert("Layer 2 Showing");
}
</SCRIPT>

</head>
<body>
<div id="layer1"> FLASH LAYER </div>
<div id="layer2"> STATIC LAYER </div>
</body>
</html>

 

and i've tried saying ...layer1).style.display="block"; that did not work either.

 

Thanks in advance.

Link to comment
Share on other sites

try this:

 

<html>
<head>
<title>FLASH DETECTOR</title>
<style type="text/css">
#layer1 /* FLASH LAYER */
{
display:none;
}
#layer2 /* STATIC LAYER */
{
display:none;
}
</style>
<SCRIPT LANGUAGE=JavaScript1.1>
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
	if (isNaN(parseInt(words[i])))
	continue;
	var MM_PluginVersion = words[i]; 
    }
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}

function check() {
if (MM_FlashCanPlay == true) {
document.getElementById("layer1").style.display="block";
alert("Layer 1 Showing");
} else{
document.getElementById("layer2").style.display="block";
alert("Layer 2 Showing");
}
}
window.onload = function() {
check();
}
</SCRIPT>

</head>
<body>
<div id="layer1"> FLASH LAYER </div>
<div id="layer2"> STATIC LAYER </div>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.