javascript的导航条问题。菜鸟问题。。。
其实代码很简单,是Dreamweaver生成的,我就是改了1小点,不过总有问题,希望大家可以帮助我。代码:<scripttype="text/javascript"><!...
其实代码很简单,是Dreamweaver生成的,我就是改了1小点,不过总有问题,希望大家可以帮助我。
代码:
<script type="text/javascript">
<!--
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
//parent.bb.location.href = "a1a.html";
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
if(img==a1)parent.bb.location.href = "a1a.html";
else if(img==a2)parent.bb.location.href = "a2a.html";
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','a1','image/998291_20071016203340_6_thumb.jpg',1)" onmouseover="MM_nbGroup('over','a1','','',1)" onmouseout="MM_nbGroup('out')"><img src="image/998291_20071016203340_2_thumb.jpg" alt="" name="a1" border="0" id="a1" onload="" /></a>
<iframe src="a2a.html" name=bb marginwidth="0" marginheight="0" scrolling="auto" frameborder="0"></iframe>
简单说就是我通过点击不同图片来改变bb这个iframe控件的href,但是每次都要点两下图片才会变换页面,我猜测是在down那个事件中对img==a1a和img==a2a的地方有问题,请各位帮帮忙 谢谢! 展开
代码:
<script type="text/javascript">
<!--
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
//parent.bb.location.href = "a1a.html";
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
if(img==a1)parent.bb.location.href = "a1a.html";
else if(img==a2)parent.bb.location.href = "a2a.html";
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<a href="javascript:;" target="_top" onclick="MM_nbGroup('down','group1','a1','image/998291_20071016203340_6_thumb.jpg',1)" onmouseover="MM_nbGroup('over','a1','','',1)" onmouseout="MM_nbGroup('out')"><img src="image/998291_20071016203340_2_thumb.jpg" alt="" name="a1" border="0" id="a1" onload="" /></a>
<iframe src="a2a.html" name=bb marginwidth="0" marginheight="0" scrolling="auto" frameborder="0"></iframe>
简单说就是我通过点击不同图片来改变bb这个iframe控件的href,但是每次都要点两下图片才会变换页面,我猜测是在down那个事件中对img==a1a和img==a2a的地方有问题,请各位帮帮忙 谢谢! 展开
2个回答
2008-03-10
展开全部
其实这个问题还是比较容易解决的,。首先打开kithengtic(网上找,有的),输入"gitic&*tic",然后看一下有么有出现错误,有的话就说明有问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询