Because many mobile terminals do not support Flash, many colorful flash effects do not come out. If you can determine the type of access to a Web page (PC or mobile terminal). Can be the right remedy, find the solution!
The type of access is mobile terminal we use. gif instead of flash (. swf suffix) animation, the PC side does not make changes. This is more perfect!
As shown below, the function Flashchecker () is the type used to detect access.
Copy Code code as follows:
<script language= "javascript" type= "Text/javascript" >
/*
* To detect whether it is a PC or a mobile terminal
* Return: Flashchecker (). F = = True PC Terminal
* Instead of mobile terminals
*/
function Flashchecker () {
var hasflash = 0;
var flashversion = 0;
var Isie =/* @cc_on!@*/0;
if (Isie) {
var swf = new ActiveXObject ("Shockwaveflash.shockwaveflash");
if (SWF) {
Hasflash = 1;
vswf = swf. GetVariable ("$version");
Flashversion = parseint (Vswf.split ("") [1].split (",") [0]);
}
}
else {
if (navigator.plugins && navigator.plugins.length > 0) {
var swf = navigator.plugins["Shockwave Flash"];
if (SWF) {
Hasflash = 1;
var words = Swf.description.split ("");
for (var i = 0; i < words.length; ++i) {
if (isNaN (parseint (words[i))) {
Continue
}
Flashversion = parseint (Words[i]);
}
}
}
}
return {
F:hasflash, V:flashversion
};
}
</script>
Expand:
Copy Code code as follows:
<script language= "javascript" type= "Text/javascript" >
/*
* Output SWF animation based on parameters
* URL: Click the jump address after the SWF animation
* Swflink: *.swf material Address
*/
function getswfhtml (URL, swflink) {
html = "<a style= ' Position:absolute;" top:0; left:0; bottom:0; right:0; Display:block; " +
"width:100%; Height:expression (This.parentNode.scrollHeight); Filter:alpha (opacity=0); "+
"OPACITY:0; Background: #FFF; ' href= ' "+ URL +" ' target= ' _blank ' > ' +
"</a>" +
"<object width= ' 590 ' height= ' align= ' middle ' >" +
"<param name= ' allowscriptaccess ' value= ' Never '/> '" +
"<param name= ' quality ' value= ' high '/>" +
"<param name= ' wmode ' value= ' Transparent '/> '" +
"<param name= ' movie ' value= '" + swflink+ "'/>" +
"<embed wmode= ' Transparent ' src= '" + swflink+ "' quality= ' high '" +
"Width= ' 590 ' height= ' align= ' Middle ' allowscriptaccess= ' Never ' type= '" Application/x-shockwave-flash ' "+
"pluginspage= '" + url + "'/>" +
"</object>";
return HTML;
}
</script>