473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to prevent div from resizing

i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically. help pls.
thx.

Dec 10 '05 #1
5 4919
wrote on 10 dec 2005 in comp.lang.javascript:
i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically. help pls.
thx.


use css overflow, overflow-x, overflow-y

Nothing to do with javascript.
Please follow up on a css NG.

example:

<div style='width:200px;overflow-x:scroll;'>
qwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqw ertyqwertyqwerty<br>
qwerty
</div>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 10 '05 #2
so something i forgot to add - it works in IE but not in Firefox.

Dec 10 '05 #3
wrote on 10 dec 2005 in comp.lang.javascript:
so something i forgot to add - it works in IE but not in Firefox.


Where are you talking about?

please quote and show relevant code.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 10 '05 #4
thx for the help. i'll transfer the problem to a css site. just
wondered if you could help me with this. the problem is this - the div
is a fixed height and a fixed width, i attach a paragraph of any length
to it. in IE, the paragraph is line-wrapped according to the width, and
if too long, a scroller appears. Firefox however, tries to put the
whole paragraph in one line and so I always have a horizontal scroller.
I'd like for it to line-wrap according to width and display only a
VERTICAL scroller if necessary. below is my div. thx for the help.
<DIV id="quoteDiv" style="OVERFLOW-X: scroll; FONT-WEIGHT: bold;
FONT-SIZE: 13pt; Z-INDEX: 101; LEFT: 0px; WIDTH: 296px; COLOR: red;
FONT-FAMILY: Arial; POSITION: absolute; TOP: 344px; HEIGHT: 290px"
ms_positioning="GridLayout">
<P id="quoteDivParagraph"></P>
</DIV>

Dec 10 '05 #5
wrote on 10 dec 2005 in comp.lang.javascript:
thx for the help. i'll transfer the problem to a css site. just
wondered if you could help me with this. the problem is this - the div
is a fixed height and a fixed width, i attach a paragraph of any length


not if you do not quote where you are replying on, after all this is
usenet, not email, and if it is an css problem, please ask in a css NG.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 10 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: phil_nospam_schmidt | last post by:
I am trying to prevent a user from resizing a frame beyond its "natural" size as given by winfo_reqwidth and winfo_reqheight, without any success. Can anyone make any suggestions, based on my code...
1
by: Aravind | last post by:
Hi folks. I have a form that has a form header and form footer, which has a few command buttons. When I open the form, I have to scroll the form from left to right to view my data. The thing is,...
1
by: cody | last post by:
How can I prevent column autosizing on doubleclick on columnheader in a ListView? -- cody Freeware Tools, Games and Humour http://www.deutronium.de.vu || http://www.deutronium.tk
1
by: perspolis | last post by:
hi everybody does anyone know how can I prevent resizing a control in design mode . at runtime I know ,but in design mode I don't know??
6
by: John Bowman | last post by:
Hi All, I must be missing something really obvious, so I'd appreciate someone helping me out. I have a simple Windows form that currently only has a title bar (aka the Text Property is set) and...
1
by: Eric Wong | last post by:
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At runtime, I dynamically create Checkboxes on the Canvas, each one on a different row. When I add a lot of Checkboxes, instead of...
2
by: vbie | last post by:
How do I prevent a row on a vb.net datagrid from being resized? I want to fix the row height of the datagrid. Ive tried the properfty PreferredRowHeight but the the row could still be resized at run...
2
by: Michael | last post by:
I need a help to prevent resizing of <TDwhen i post inside this <TDhtml text of other web page. Thanks
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
2
by: Haren786 | last post by:
VB6 Form resize diable user from manually resizing it?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.