灯箱不工作

时间:2010-02-23 14:49:07

标签: javascript scriptaculous lightbox

我下载了&按照关于如何设置here灯箱效果的说明,但它不起作用view请帮助我。

头部分

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="lightbox.css" type="text/css" media="screen" />
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

在菜单部分,我拥有所有这些:

<tr>
            <td><a href="index.php"><img src="<? if ($url =="home") {echo "images/menu-over_07.gif";} else {echo "images/menu_07.gif";}?>" width="143" height="30" border="0" id="Image1" onmouseover="MM_swapImage('Image1','','images/menu-over_07.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
          </tr>
          <tr>
            <td><a href="method.php"><img src="<? if ($url =="method") {echo "images/menu-over_09.gif";} else {echo "images/menu_09.gif";}?>" width="143" height="35" border="0" id="Image2" onmouseover="MM_swapImage('Image2','','images/menu-over_09.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
          </tr>
          <tr>
            <td><a href="classes.php"><img src="<? if ($url =="classes") {echo "images/menu-over_10.gif";} else {echo "images/menu_10.gif";}?>" width="143" height="35" border="0" id="Image3" onmouseover="MM_swapImage('Image3','','images/menu-over_10.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
          </tr>
          <tr>
            <td><a href="private.php"><img src="<? if ($url =="private") {echo "images/menu-over_11.gif";} else {echo "images/menu_11.gif";}?>" width="143" height="40" border="0" id="Image4" onmouseover="MM_swapImage('Image4','','images/menu-over_11.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
          </tr>
                    <tr>
            <td><a href="gallery.php"><img src="<? if ($url =="gallery") {echo "images/menu-over_12.gif";} else {echo "images/menu_12.gif";}?>" width="143" height="40" border="0" id="Image6" onmouseover="MM_swapImage('Image6','','images/menu-over_12.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
          </tr>
          <tr>
            <td><a href="contact.php"><img src="<? if ($url =="contact") {echo "images/menu-over_13.gif";} else {echo "images/menu_13.gif";}?>" width="143" height="36" border="0" id="Image5" onmouseover="MM_swapImage('Image5','','images/menu-over_13.gif',1)" onmouseout="MM_swapImgRestore()" /></a></td>
  </tr>

这是javascript的条带化代码,在我尝试逐一取出的页面中,但没有运气来解决它。

1 个答案:

答案 0 :(得分:1)

你错过了effects.js文件。如果您查看页面js,该文件将以404返回。

http://www.testground.idghosting.com/aline/js/effects.js