Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 09-15-2005, 04:55 AM
  #1
soumik
Novice (Level 1)
 
Join Date: Sep 2005
Posts: 10
iTrader: (0)
soumik is an unknown quantity at this point
iframe scrolling property does not work

hi to all,

i hav one inline frame. the scrolling property of the iframe is "no" by default. what i want for a specific page it turns into "yes". so what i'm doing is targeting the iframe by id and changing the scrolling properties of it.. .. but it does not seem to be working properly. here is the code

<script language="JavaScript" type="text/JavaScript">
function scroll() {
parent.document.getElementById("iframe").scrolling='yes';
}
</script>

iframe id=mid
width=100%
height=100%

i'm calling the function on body load of a html which is going to load inside the iframe, thts why i had started with .parent so that it goes one up level, since the main iframe(mid) is located in the up level page.

i dont hav any problem when i apply the same code with the "width" property of the iframe, where the code is

function scroll() {
parent.document.getElementById("mid").width=400;
}

however, i want the code to modify the scrolling properties, not the widh....

if anyone has got any idea about the problem, i'm begging for it.. i need that to happen very badly...

thanx in advance..

soumik
soumik is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-15-2005, 07:36 AM
  #2
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,922
iTrader: (0)
coothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to beholdcoothead is a splendid one to behold
Hi there soumik,

and a warm welcome to these forums.
Unfortunately, Firefox appears to be the only browser that accepts...
Code:
document.getElementById("iframe").scrolling='yes'
You may be interested in this, if somewhat inelegant, work-a-round...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224">
<html>
<head>
<title>create iframe scrolling</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
<!--
function scroll() {
     parent.document.getElementById("foo").innerHTML=
     '<iframe id="iframe" src="http://www.google.com/" width="400" height="500" scrolling="auto"><\/iframe>' 
 }
//-->
</script>

</head>
<body>

<div onclick="scroll()">click here for iframe scrolling</div>

<div id="foo">
<iframe id="iframe" src="http://www.google.com/" width="400" height="500" scrolling="no"></iframe>
</div>

</body>
</html>
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-20-2005, 01:40 AM
  #3
soumik
Novice (Level 1)
 
Join Date: Sep 2005
Posts: 10
iTrader: (0)
soumik is an unknown quantity at this point
thank you very very much coothead. that solves my problem.
soumik is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 09-20-2005, 02:30 AM
  #4
_Aerospace_Eng_
The CSS Master (somewhat)
 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a galaxy far far away...
Posts: 11,154
iTrader: (0)
_Aerospace_Eng_ has disabled reputation
Why even use javascript for this? Why not just use scrolling="auto" if the page being iframed needs scrollbars it will acquire them. If it doesn't need them it will act the same way as scrolling="no"
__________________

76 invites left. PM me for a Gmail invite along with email addy.
Why we won't help you .::. Web Developer's Handbook .::. Why Tables for Layout is Stupid?
_Aerospace_Eng_ is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 12:25 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.