Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Disabling Horizontal Scroller In Iframe?


19 replies to this topic

#11 weblin

    Newbie

  • Kontributors
  • Pip
  • 1 posts

Posted 21 May 2005 - 11:06 AM

Amezis, on Apr 6 2005, 06:47 PM, said:

Is there a way to disable the horizontal scroller in iframes? If yes, how can I do it?

View Post


Hi, Amezis!
I recently found a little trick that can help to hide only horizontal scrollbar in iframe. First I tried to kill this scrollbar width css overfow-x feature etc. but no success - there always was a little lag in iframe document width at least at scrollbar width.
I supposed that IE just set document width to iframe clientWidth (but for some reason IE returns full iframe width INCLUDING scrollbars). Then I set to body tag in iframe src document style="width:NNNpx" (where NNN < iframe width on scrollbar width). And voila!
But it can be made more universal by attaching simple javascript function to onload event in src document. It seems that IE needs just to get scrollWidth value of iframe doc just once(!) and everything will be fixed. Magic... :lol:
Smtng like:

....
<script>
function trimSize() {
	var ff = document.body.scrollWidth;
	document.body.style.width = ff+"px";
}
</script>
</head>

<body onLoad="trimSize();">
....


#12 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 13 March 2008 - 02:29 AM

about the removal of the horizontal scrolling-bar in iFrames
Disabling Horizontal Scroller In Iframe?

I've also had the same pb with the horizontal scrolling-bar ...
I've tried resizing the framed page with <b>{width:95%}</b>, tried with <b>overflow-x:hidden</b>, tried deleting the DTD lines at the top of the page ... None of them worked !

Here's the answer [I found it somewhere on the net, looking stupid, but it works] ... For scrolling in the iFrame I've set value "yes" (<b>scrolling="yes"</b>), so I got rid of the horizonal bar. Then I checked the site in Mozilla and it appeared here (previously it was allright in Mozilla), so I've added <b>style="overflow-x:hidden;"</b> ... So it worked with Mozilla also.

Here's the complete lines:

<IFRAME name=stbbox src="serv_frame.Html" width="365" height="300" scrolling="yes" style="overflow-x:hidden;" frameborder="0" marginheight="0" marginwidth="0" vspace="0" hspace="0">
<p>Your browser doesn't support frames. Click <a href="serv_frame.Html" target="_blank">here</a> to view the page.</p>
</IFRAME>

Hope you enjoy it as I do !!

-reply by Calin

#13 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 02 April 2008 - 04:18 PM

Replying to Trap FeedBacker

You can use horizontalscrolling="no/yes" and verticalscrolling="no/yes"

An example of this will be on lornamacdonald.Co.Uk shortly, as an image preview scrollbar.

Here is the entire thread of code I have used:

<iframe width="600px" height="100" id="iframe_id" name="iframe_name" src="commercial.Htm" horizontalscrolling="yes" verticalscrolling="no" marginwidth="0" marginheight="0" frameborder="0" ALLOWTRANSPARENCY="true" onload=resize_iframe();></iframe>

If you are using iframes, search for iframe resize on google for a nifty little javascript code that I use at the end..

#14 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 17 June 2008 - 11:54 AM

Hide Horizontal scroll bar of IFRAME.
Disabling Horizontal Scroller In Iframe?

How to hide horizontal scroll bar using IFRAME control.

I want only vertical scroll bar.

If description width is long then appear horizontal scroll bar but I not want horizotal scroll bar any way.

Help me.

-reply by piyush

#15 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 15 October 2008 - 10:30 PM

GENIUS!!!
Disabling Horizontal Scroller In Iframe?

Replying to iGuest I searched and searched for a solution to this D@mn scrollbar problem, tried numerous 'solutions', YOURS actually worked. Thank you, thank you, thank you!!

-reply by Sedge11

#16 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 23 January 2009 - 06:27 AM

Solution to iFrame horsizontal scroll issueDisabling Horizontal Scroller In Iframe?

scrolling="yes"  horizontalscrolling="no" verticalscrolling="yes"

Set scrolling to 'yes' in your iFrame tag BUT explicitly state that you are going to have NO horizontal scroll. It works. :)



#17 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 12 February 2009 - 07:42 AM

another wayDisabling Horizontal Scroller In Iframe?

[font=" Verdana; font-size: 13px"]Disabling Horizontal Scroller In Iframe?[/font]

[font=" Verdana; font-size: 13px"]just add to the body tag of the page you're embedding in the iframe style="overflow-x:hidden;".[/font]

[font=" Verdana; font-size: 13px"]<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 scroll=yes style="overflow-x:hidden;">[/font]



#18 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 03 July 2009 - 04:48 AM

overflow-xDisabling Horizontal Scroller In Iframe?

your answer was awesome!  I've been trying to do that for years.  thank you!

-reply by lisa

#19 Guest_crazyman_*

  • Guests

Posted 05 November 2010 - 06:56 PM

Excellent..It works like charm :) Thank you buddy.

#20 Guest_abhishek2408_*

  • Guests

Posted 18 May 2012 - 08:01 AM

This works!! thanks!!

View PostiGuest, on 12 February 2009 - 07:42 AM, said:

another wayDisabling Horizontal Scroller In Iframe?
[font=" Verdana; font-size: 13px"]Disabling Horizontal Scroller In Iframe?[/font]
[font=" Verdana; font-size: 13px"]just add to the body tag of the page you're embedding in the iframe style="overflow-x:hidden;".[/font]
[font=" Verdana; font-size: 13px"]<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 scroll=yes style="overflow-x:hidden;">[/font]





Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users