Closed Thread Icon

Preserved Topic: Can I detect horizontal scrollbars? Pages that link to <a href="https://ozoneasylum.com/backlink?for=18043" title="Pages that link to Preserved Topic: Can I detect horizontal scrollbars?" rel="nofollow" >Preserved Topic: Can I detect horizontal scrollbars?\

 
Author Thread
lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 07-31-2001 10:44

Is there is a way to check if horizontal are present then I resize my window so all the content appear w/o the need to scroll horizontally.


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-31-2001 14:23

A) no.
B) don't resize the users window, it's incredibly annoying. A great way to get people to leave.

Make your page work in 800 x 600 so that you don't need to worry about it.

[edit]I just realized that I sound like a jerk from this message! My bad, didn't mean to. Have a nice day =) [/edit]

[This message has been edited by Slime (edited 07-31-2001).]

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 08-01-2001 08:37

Actually I'm resizing sort of a debug window and not any site.
It's just a debug window that pops up and start displaying diagnostic messages.
That why when the message is too long and doesn't fit in that window I want the debug system to shrink that window.

So bascially I can't do that?

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-01-2001 14:17

Well, there is a way, with JavaScript you can find the width of an element containing text (in good browsers, at least). However, you should upload it and give us a link to it, because there may be a better way to solve the problem that we could point out, or if there isn't, we'll almost certainly need the page to be able to show you how to find the width of the text.

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 08-01-2001 15:11

that's the complete testing code, just copy and paste it...

code:
<html>
<head>
<title>scroll bar detection</title>
<script language="JavaScript">
<!--
var w = null;
function showwindow()
{
w = window.open("about:blank", "test_window", "location=0, width=500, height=200, status=1, scrollbars=1");
d = w.document;
d.write('Short text! (won\'t cause the scrollbars): Hi all!<br>');
d.write('Long text (will cause scrollbars): WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW<br>');
}
//-->
</script>
</head>
<body>
<form>
<input type="button" value="show window" onclick="showwindow();">
</form>
</body>
</html>



Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-01-2001 16:48

OK, well, for one thing, I'm pretty sure you're not allowed to use spaces in the "location=0, width=500, height=200, status=1, scrollbars=1" thing. Maybe it's working, but I don't think it's supposed to be allowed to have spaces.

Um, well, the way you're doing things now, you can't really tell if the text is too wide or not. But the thing is, it should only be a problem if there are no spaces - you'll notice sometimes people post long words in these forums, and they stretch the table. But if you break it up with spaces, the words will wrap around.

Is that a possibility for fixing it? Or do you *need* to have long words without spaces?

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 08-02-2001 12:10

>do you *need* to have long words without spaces?

yes long words w/o spaces...that just arbitrary output remember...? (it's a debug window).
even though I can use PHP's WordWrap() but it's also okay.


« BackwardsOnwards »

Show Forum Drop Down Menu