灯箱不工作
在标题部分:
<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 的精简代码,我尝试将它们一一取出,但是没有运气修复它。
I downloaded & followed the instruction on how to set up the Lightbox effect from here but it is not working view please help me.
in the Head section:
<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>
In the Menu section i have all this:
<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>
This are the strip down code of javascript that is in the pages I tried taking them out one by one but no luck in getting it fix.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您缺少effects.js 文件。如果您查看页面 js,该文件将返回 404。
http ://www.testground.idghosting.com/aline/js/effects.js
You're missing the effects.js file. If you look at your page js, that file is coming back with a 404.
http://www.testground.idghosting.com/aline/js/effects.js