Forum Moderators: open

Message Too Old, No Replies

Disabling an iframe's scrollbars

         

MihaiOlaru

11:16 am on Feb 10, 2005 (gmt 0)

10+ Year Member



Hi there

I have 2 links that loads 2 diferent pages in an iframe. The page loaded by the first link needs scrolling in the iframe, while the second page doesn't. I know this can be solved reloading the main page when clicking the link, but this is not possible, so I thought that it may be some javascript trick that cand disable the iframe's scrolling when a link is clicked.

I already tried changing the iframe's css style with javascrip (overflow: hidden¦visible) but it does not works.

Ideeas, anyone?
Thanks

orion_rus

10:43 am on Feb 14, 2005 (gmt 0)

10+ Year Member



make it like this
<iframe id="coolid"></iframe>
<script>
document.getElementById('coolid').scrolling="no";
</script>
I think it should work) good luck to you

MihaiOlaru

4:20 pm on Feb 14, 2005 (gmt 0)

10+ Year Member



Thanks for your response, orion_rus.
Your code works, but it is not what I need.

I've tried to build this code, but it doesn't works:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function f1()
{ document.getElementById('coolid').scrolling="no"; }
function f2()
{ document.getElementById('coolid').scrolling="yes"; }
</script>
</head>
<body>

<input type="button" value="NO" onClick="f1();">
<input type="button" value="YES" onClick="f2();">
<iframe id="coolid" src="http://www.google.com/"></iframe>

</body>
</html>

Now, where's the mistake?