日期:2014-05-16  浏览次数:20396 次

如何获取地址后弹出层显示视频
提供一些我自己的代码..
求解说..

-------------------------------------JS-----------------------------------
function show(tag){
 var light=document.getElementById(tag);
 var fade=document.getElementById('fade');
 light.style.display='block';
 fade.style.display='block';
 }
function hide(tag){
 var light=document.getElementById(tag);
 var fade=document.getElementById('fade');
 light.style.display='none';
 fade.style.display='none';}

function showDaTu(src){
document.getElementById("defaultImg").src=src;
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
  var isIE = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
  var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
  if (!isIE || !isWin){  
  var flashVer = -1;
  if (plugins && plugins.length > 0){
  var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
  desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
  if (desc == "") flashVer = -1;
  else{
  var descArr = desc.split(" ");
  var tempArrMajor = descArr[2].split(".");
  var verMajor = tempArrMajor[0];
  var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
  var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
  flashVer = parseFloat(verMajor + "." + verMinor);
  }
  }
  // WebTV has Flash Player 4 or lower -- too low for video
  else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

  var verArr = reqVerStr.split(",");
  var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
  if (flashVer < reqVer){
  if (confirm(msg))
  window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
  }
  }
  } 
}



----------------------------------JS结束----------------------------------


---------------------------------HTML---------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>视频测试</title>
<link rel="stylesheet" type="text/css" href="../css/body.css">
<script type="text/javascript" src="../JS/tanchu.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
  </head>
<body onload="MM_CheckFlashVersion('7,0,0,0','本页内容需要使用较新的 Macromedia Flash Player 版本。是否现在下载它?');" style="text-align:center;">
<div id="light" class="white_content">
  <div class="close"><a href="javascript:void(0)" onclick="hide1('light')"> 关闭</a></div>
  <div class="con"> 
<center>
<object classid="clsid: