Jump to content
xisto Community
Sign in to follow this  
Amezis

Disabling Horizontal Scroller In Iframe? How can I do that?

Recommended Posts

if u set the width no larger that the view screen, then it would be no scrollbar i think.Im not very sure about this. I've use the width attribute to do this before. Sure there are some other ways

Share this post


Link to post
Share on other sites

why would you want to do that? if the visitor's browser is not at full size, your frame will be very compressed without the horizontal scroll bar

Share this post


Link to post
Share on other sites

if you set scrolling to no the iframe will have no scrollbars but I don't know how to disable just the horizontal scrollbar.It would be like the frames Xisto uses.

Share this post


Link to post
Share on other sites

The option in Microsoft FrontPage edits both scrollbars not one individually. Even if you try write the HTML through a programe like WordPad i don't think you can set only one scrollbar to change. I don't see why you would want to though :)

Share this post


Link to post
Share on other sites

Well, it's because I have a shoutbox, and sometimes a horizontal scrollbar appears, well it's not that annoying, but it could be better without. It's a bug that only happen sometimes...

Share this post


Link to post
Share on other sites

Use This Code for That ::<iframe id="datamain" src="Html address " width="Size" height="Size" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>if marginwidth and marginheight and frameborder = 0 iframe load with out any bordar and any 3d style if scrolling = no dont show scroll and if = yes it show scrolls in front page u can first put your iframe and then in html code find iframe tag and edit scrolling to no

Share this post


Link to post
Share on other sites

Hello, to answer your question:

I'll attempt to explain this by using an example. Let's say your iframe source is called shoutbox.html and your division ID for the style of the shoutbox is under #div.

This is what you put in your style tags:

#div {overflow-x: hidden;}

Of course you have other things in between, I'm sure there are colour and width and height and other specifications. But to hide the horizontal scrollbar that is what you do. :D

Then how to call it up would be to insert the id into the iframe tag.

Like so:

<iframe src="shoutbox.html" id="div"></iframe>

Alternate method (easier method):

If you are not sure about using CSS, then directly edit the HTML by inserting this into the divison tag.

<iframe src="shoutbox.html" style="overflow-x: hidden;"></iframe>

Hope that was helpful :( If you still have problems, you are welcome to PM me or IM me or bug other more knowledgeable people on the forums heheh :( (but I can't guarantee that they'll welcome it :()

Share this post


Link to post
Share on other sites

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

68990[/snapback]


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();">....

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Replying to Trap FeedBackerYou 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..

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.