我是用treeview做的菜单,要求点击父菜单,图片要转换,调用了js,不知道为何ie6.0的浏览。点击前的图片是可以显示的,点击后的图片显示不出来,对那个图片右击图片显示,图片才出来?但是很奇怪,ie7.0以上的却可以将图片正常显示。。未点击前的图片为_yi,点击后的图片为_er,下面是调用的js文件:
function GoClick()
{
var obj = event.srcElement;
var tb=obj;
if (tb.tagName.toUpperCase()=="IMG")
{
if(tb.parentElement.tagName.toUpperCase()=="A")
{
tb=tb.parentElement;
}
}
tb=tb.parentElement.parentElement.parentElement.parentElement;
try
{
if (tb.nextSibling.tagName.toUpperCase()=="DIV")
{
var td;
if (obj.tagName.toUpperCase()=="A")
{
td=obj.parentElement;
}
else if(obj.tagName.toUpperCase()=="IMG")
{
td=obj.parentElement.parentElement.nextSibling;
}
if (td.className.indexOf("level_click_1") >= 0)
{
td.className=td.className.replace("level_click_1","level1 ");
}
else
{
td.className=td.className.replace("level1","level_click_1");
}
if (td.previousSibling.firstChild.firstChild.src.indexOf("_yi")>0)
{
td.previousSibling.firstChild.firstChild.src=td.previousSibling.firstChild.firstChild.src.replace("_yi","_er");
}
else
{
td.previousSibling.firstChild.firstChild.src=td.previousSibling.firstChild.firstChild.src.replace("_er","_yi");
}
if (td.className.indexOf("level2_click") >= 0)
{
td.className=td.className.replace("level2_click","level2 ");
}
else
{
td.className=td.className.replace("level2","level2_click");
}
}
}
catch(e){}
}
请各位大侠们,帮忙看看给点意见,如何解决?
function GoClick()
{
var obj = event.srcElement;
var tb=obj;
if (tb.tagName.toUpperCase()=="IMG")
{
if(tb.parentElement.tagName.toUpperCase()=="A")
{
tb=tb.parentElement;
}
}
tb=tb.parentElement.parentElement.parentElement.parentElement;
try
{
if (tb.nextSibling.tagName.toUpperCase()=="DIV")
{
var td;
if (obj.tagName.toUpperCase()=="A")
{
td=obj.parentElement;
}
else if(obj.tagName.toUpperCase()=="IMG")
{
td=obj.parentElement.parentElement.nextSibling;
}
if (td.className.indexOf("level_click_1") >= 0)
{
td.className=td.className.replace("level_click_1","level1 ");
}
else
{
td.className=td.className.replace("level1","level_click_1");
}
if (td.previousSibling.firstChild.firstChild.src.indexOf("_yi")>0)
{
td.previousSibling.firstChild.firstChild.src=td.previousSibling.firstChild.firstChild.src.replace("_yi","_er");
}
else
{
td.previousSibling.firstChild.firstChild.src=td.previousSibling.firstChild.firstChild.src.replace("_er","_yi");
}
if (td.className.indexOf("level2_click") >= 0)
{
td.className=td.className.replace("level2_click","level2 ");
}
else
{
td.className=td.className.replace("level2","level2_click");
}
}
}
catch(e){}
}
请各位大侠们,帮忙看看给点意见,如何解决?
解决方案 »
- 知道MVC 2的朋友进来看一看
- 我在页面上添加个图片 怎么打开网页是个X 无法显示啊
- 一个关于asp.netMVC的问题
- 经典注册页面的实现方法
- 在ASP.NET中Repeater控件实现方法
- 关于下拉框显视数据项的问题.....
- <%# ((DataRowView)Container.DataItem).Row.GetChildRows("myrelation") %>这句代码是什么意思?
- 关于DownDropList联动的问题
- Sql Server难题,20天无人能解。
- webapi2 selfhost 服务通过浏览器访问400错误
- 本人的一个网站最新上线,但有些问题,请大家指点指点啊!
- 水晶报表的做法
.previousSibling.firstChild.firstChild.src=td.previousSibling.firstChild.firstChild.src.replace("_yi","_er")+"?a="+Math.Random().toString()