更改HTML对象Zindex [英] Change Html Object Zindex

查看:68
本文介绍了更改HTML对象Zindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我的页面中有一个对象.我想在上面找到一个div,它可以在Firefox和Chrom中工作,但不能在ie中工作.

Asp的菜单可以位于该对象上,但其他html元素不能放置在该对象上
所以我想要一个好的解决方案.

例子:

Hi all
I have an Object in my page. I want locate a div on that, This work in Firefox and Chrom but not in ie.

Asp''s Menu can locate on this object but other html elements cant''t be place on that
so I Want a good solution for that.

Example :

<HTML>
<HEAD>
<TITLE>Z-Index</TITLE>
<script>
function setindex()
{
    div1.style.zIndex=text1.value;
    select1.style.zIndex=text2.value;
    getindexes();
}

function getindexes(){

    text1.value=div1.style.zIndex;
    text2.value=select1.style.zIndex;
    text3.value=5;
}
</script>
</HEAD>
<BODY onload="getindexes()">

Div
<input type="text" value="" id=text1 name=text1 ><p>

Select
<input type="text" value="" id=text2 name=text2><p>

IFrame
<input type="text" value="" id=text3 name=text3><p>
<input type="button" value="Set Z-Index" id=button1 name=button1 onclick="setindex()">
<DIV id=div1 name=div1  style="width:200;height:200;background-color:lightblue;
position:absolute;left:350;top:250;z-index:">DIV</DIV>
<select id=select1 name=select1 style=";position:absolute;left:300;top:400;width=300;z-index:"

size=1 >
    <option>Option1
    <option>Option2
    <option>Option3
</select>
<object id="iframe1 " type="text/html" style="width:100;height:115;position:absolute;
left:400;top:300;border-color:green;z-index:5">
</object>
</BODY>
</HTML>




请帮帮我
谢谢




Please Help me
Thanks

推荐答案

您应该给 jQuery [
You should give jQuery [^] a try; it will encapsulate the different DOM into one API.


这篇关于更改HTML对象Zindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆