471,336 Members | 1,293 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

Javascript DOM Opera vs IE

Strangely I came acros a problem in IE performing little asp/javascript
model:

code:
<script type="text/javascript">
function turn_on_files(folder)
{
x=event.clientX+25
y=event.clientY+25
document.getElementById('files_frame').style="visi bility:visible;z-index=9;position:absolute;left:"+x+"px;top:"+y+"px ;";
document.getElementById('files_frame').src="http://www.somesite.com/chart.asp?width=300&height=240&charttype=line&name ="+folder;
}
function turn_off_files()
{
document.getElementById('files_frame').style="visi bility:hidden;z-index=9;position:absolute";
}
</script>

......

<iframe id=files_frame
src="http://ratool.win.vipnet.hr/chart.asp?width=300&height=240&charttype=line&name =tapin_udr"
width=300 height=240 frameborder=0 marginheight=0 marginwidth=0
scrolling=no
style="visibility:hidden;z-index=9;position:absolute;left:50px;top:20px;"></iframe>

.......
<div onmouseover=turn_on_files("some_text")
onmouseout="turn_off_files()"><img src=images/red_dot_blink.gif></div>

This works fine in Opera, but in IE I get strange error:
Permisssion denied: line 11 or line 17
when i trigger this event...
line 11 or 17 are "document.getElementById('files_frame').style" lines
in javascript...

Jul 27 '06 #1
2 2677


ze***********@gmail.com wrote:

document.getElementById('files_frame').style="visi bility:visible;z-index=9;position:absolute;left:"+x+"px;top:"+y+"px ;";
The style property is an object with individual properties for the CSS
properties so you need to do
var element = document.getElementById('files_frame');
element.style.visibility = 'visible';
element.style.zIndex = '9';
element.style.position = 'absolute';
and so on for all the properties you want to set.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 27 '06 #2
Martin Honnen wrote:
ze***********@gmail.com wrote:

document.getElementById('files_frame').style="visi bility:visible;z-index=9;position:absolute;left:"+x+"px;top:"+y+"px ;";

The style property is an object with individual properties for the CSS
properties so you need to do
var element = document.getElementById('files_frame');
element.style.visibility = 'visible';
element.style.zIndex = '9';
element.style.position = 'absolute';
and so on for all the properties you want to set.
Thanx, this solved my problem! :)

Jul 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.