aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Scroll bar missing on Windows PC's? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Scroll bar missing on Windows PC Watch "Scroll bar missing on Windows PC New topic
Author

Scroll bar missing on Windows PC's?

Kristine Hanson
Greenhorn

Joined: Apr 05, 2001
Posts: 10
Hello, I am web graphics designer that uses a Mac, I specialize in animations- so I was really tickled by the free floating (bouncing) javascripts UNTIL I discovered on Windows PC's that when pasted onto a page that requires scrolling the scroll bar never appears!
This is the first time I have ever seen a script that works better on Mac than on Windows! LOL! PLEASE!I Is there anyway to make the scroll bar come back on Windows? (If you would like to see an example of what I mean, please go to: http://lagringaloca.com/intro/intro.htm) Thanks! (Ive posted this question on a couple other forums but have received NO replies. I also found this same question posted by others with NO replies... so I am really hoping this is not something no one knows how to fix! LOL!)
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Two comments. The link that you provided does not work. Javascript is not really related to Java, so I am going to move this post to the HTML and Javascript forum.
You will need to post the javascript code if you want help.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Kristine Hanson
Greenhorn

Joined: Apr 05, 2001
Posts: 10
Thank you for moving me to the appropriate forum! Here is the script that the scrollbar is absent in Windows (both IE & NS):
<script>
<!-- Beginning of JavaScript -
// CREDITS:
// FlyingPictures by Urs Dudli and Peter Gehrig
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com
// info@24fun.ch
// 8/30/2000
// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to http://www.24fun.com/fast/index.html
// right into the webpage where the script will be displayed.
// CONFIGURATION:
// Go to http://www.24fun.com/fast/index.html, open category 'animation' and
// download the ZIP-file of this script containing
// the script-file with step-by-step instructions for easy configuration as well as
// all testimages
// URLs of floating images. Add as many images as you like.
// ATTENTION: Too many images will dlow down the floating effect)
var your_image=new Array()
your_image[0]="imgfloatingpics1.jpg"
your_image[1]="imgfloatingpics2.gif"
your_image[2]="imgfloatingpics3.jpg"
your_image[3]="imgfloatingpics4.jpg"
your_image[4]="imgfloatingpics4.jpg"
your_image[5]="imgfloatingpics4.jpg"
// You may add links for each image separately.
// In case you do not want to link a picture just add a '#' instead of an URL (see sample below)
var your_image_link=new Array()
your_image_link[0]="http://www.yahoo.com"
your_image_link[1]="http://www.altavista.com"
your_image_link[2]="http://www.google.com"
your_image_link[3]="#"
your_image_link[4]="http://www.excite.com"
your_image_link[5]="http://www.lycos.com"
// average speed of the floating images. Higher means faster
var floatingspeed=10
// do not edit the variables below
var tempo=20
var numberofimages=your_image.length-1
var stepx=new Array()
var stepy=new Array()
for (i=0;i<=numberofimages;i++) {
stepx[i]=randommaker(floatingspeed)
stepy[i]=randommaker(floatingspeed)
}
var imgwidth=new Array()
var imgheight=new Array()
for (i=0;i<=numberofimages;i++) {
imgwidth[i]=10
imgheight[i]=10
}
var x,y
var marginbottom
var marginleft=0
var margintop=0
var marginright
var timer
var spancontent=new Array()
var imgpreload=new Array()
for (i=0;i<=your_image.length;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=your_image[i]
}
for (i=0;i<=numberofimages;i++) {
spancontent[i]="<a href='"+your_image_link[i]+"'><img src='"+your_image[i]+"' border='0'></a>"
}
function setValues() {
if (document.all) {
marginbottom=document.body.clientHeight-5
marginright=document.body.clientWidth-5
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.all.span"+i)
thisspan.innerHTML=spancontent[i]
var thisspan = eval("document.all.span"+(i)+".style")
thisspan.posLeft=randommaker(marginright)
thisspan.posTop=randommaker(marginbottom)
}
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.all.span"+i)
imgwidth[i]=thisspan.offsetWidth
imgheight[i]=thisspan.offsetHeight

}
checkmovement()
}
if (document.layers) {
marginbottom=window.innerHeight-5
marginright=window.innerWidth-5
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i+".document")
thisspan.write(spancontent[i])
thisspan.close()
var thisspan=eval("document.span"+i)
thisspan.left=randommaker(marginright)
thisspan.top=randommaker(marginbottom)
}
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i+".document")
imgwidth[i]=thisspan.width
imgheight[i]=thisspan.height
}
checkmovement()
}
}
function randommaker(range) {
rand=Math.floor(range*Math.random())
if (rand==0) {rand=Math.ceil(range/2)}
return rand
}
function checkmovement() {
if (document.all) {
checkposition()
movepictures()
timer=setTimeout("checkmovement()",tempo)
}
if (document.layers) {
checkposition()
movepictures()
timer=setTimeout("checkmovement()",tempo)
}
}
function movepictures() {
if (document.all) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.all.span"+(i)+".style")
thisspan.posLeft+=stepx[i]
thisspan.posTop+=stepy[i]
}
}
if (document.layers) {
for (i=0;i<=numberofimages;i++) {
var thisspan = eval("document.span"+i)
thisspan.left+=stepx[i]
thisspan.top+=stepy[i]
}
}
}
function checkposition() {
if (document.all) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.all.span"+i+".style")
if (thisspan.posLeft>marginright-imgwidth[i]) {
thisspan.posLeft-=Math.abs(stepx[i]+1)
stepx[i]=randommaker(floatingspeed)*-1
}
if (thisspan.posLeft<marginleft) {
thisspan.posLeft+=Math.abs(stepx[i])
stepx[i]=randommaker(floatingspeed)
}
if (thisspan.posTop>marginbottom-imgheight[i]) {
thisspan.posTop-=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)*-1
}
if (thisspan.posTop<margintop) {
thisspan.posTop+=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)
}
}
}
if (document.layers) {
for (i=0;i<=numberofimages;i++) {
var thisspan=eval("document.span"+i)
if (thisspan.left>marginright-imgwidth[i]) {
thisspan.left-=Math.abs(stepx[i]+1)
stepx[i]=randommaker(floatingspeed)*-1
}
if (thisspan.left<marginleft) {
thisspan.left+=Math.abs(stepx[i])
stepx[i]=randommaker(floatingspeed)
}
if (thisspan.top>marginbottom-imgheight[i]) {
thisspan.top-=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)*-1
}
if (thisspan.top<margintop) {
thisspan.top+=Math.abs(stepy[i])
stepy[i]=randommaker(floatingspeed)
}
}
}
}
// - End of JavaScript - -->
</script>
<body id="thisbody" bgcolor="#FFFFFF" onLoad="setValues()" style="width:100%;overflow-x:hidden;overflow-y:hidden">
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=numberofimages;i++) {
document.write("<span id='span"+i+"' style='position:absolute'></span>")
document.close()
}
// - End of JavaScript - -->
</script>
<DIV id="deletethisblock" style="position:absolute;top:50px;left:50px;">
<font size=1 face=Verdana><ul><b>FlyingPictures: make your images float through your webpage</b>
<li>This is the latest follow-up of the popular flying-picture-script.
<li>Make your pictures float through your webpage like ballons.
<li>The movement is driven by a smart random-function that changes the speed and direction for each image separately.
<li>Add as many images as you like.
<li>Each image can be linked separately.
<li>Crossbrowser.
</ul>
<ul>
<b>Configuration</b>
<li><a href="imgfloatingpics.zip">Download the script as ZIP-file</a>, extract the HTML-file and the testimages and save them both into the same folder.
<li>Open the HTML-file, go the <head>-section of the file and configure the url of the floating images, the links of the floating images and the speed of the average speed of the movement.
<li>Go to the <body>-section of the HTML-file and delete the <div>-block with the id "deletethisblock".
<br>
<hr>
<a href="http://www.24fun.com/fast/index.html" target="_blank">Get more free funscripts from SpeedScripts.</a><br><br>
<script src="http://www.24fun.com/affiliates/textaboutxml.js"></script><br>
<script src="http://www.24fun.com/affiliates/textaboutjavascript.js"></script><br>
</font>
</ul>
</DIV>
</body>
</html>
PS. I have even tried embedding the page in a frames to no avail, it STILL refuses to show a scroll bar in the frame!
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Sorry about the delay. I posted a reply a few days ago, but it appears to have gotten lost when the site crashed. Anyhoo...
This line appears to be the culprit:

If you remove the "overflow-y:hidden" from the <body> tag, you will get a scroll bar. On my PC, I run in 1024x768 and I had to add some <BR> tags and text at the end of the page to activate the scrollbar.
HTH
Kristine Hanson
Greenhorn

Joined: Apr 05, 2001
Posts: 10
Thank you so much! I did see your reply and replied to thank you before the crash. I was hoping you might be able to recommend a good book (or maybe the ranch has a pdf file I could download) that could help me identify the likely suspects when I need to troubleshoot a script? Amazingly enough, I somehow instinctively suspected it was something in the "<body id="thisbody" bgcolor="#FFFFFF" onLoad="setValues()" style="width:100%;overflow-x:hidden;overflow-y:hidden">" line- because strangely enough I recreated this no scroll bar phenomenon with yet another floating script that originally HAD scrollbars- that is until I tried editing it in Adobe's GoLive (where it arbitrarily moved the javascript around and messed up the '<div id="object1" style="position:absolute;..." line) I know, I know... thats what I get for being lazy and using a WYSIWYG editor! LOL! So now I am back to using good old BBEdit. Anywhoo, any advice on troubleshooting would muchly be appreciated
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Promise you won't tell anybody, but I do most of my JavaScript and HTML editing in VisualInterdev because I write a lot of ASP. SSHHHHHH! Don't tell the Java people! Unfortunately, I can't say that I have used anything else enough to recommend it. Sorry.
[This message has been edited by Bodie Minster (edited April 13, 2001).]
Kristine Hanson
Greenhorn

Joined: Apr 05, 2001
Posts: 10
Might Dreamweaver UltraDev be a second cousin to this VisualInterdev? You see, I have Dreamweaver too- I've got this poor G3 purdy much crammed full- ..but I think I can get a pretty good deal on an upgrade to UltraDev! ... aaaaaaand I am admittedly soullessly fickle & completely unloyal about editing software- So!I would DROP GO-LIVE in a heartbeat, iffen Dreamweaver UltraDev can actually CORRECT problems in javascript!??
Shuckydarn Mister Bodey, I'd be downright tickled iffen (unlike GoLive) it would just resist & restrain itself from rewriting working javascripts into unworking javascripts! LOL! (so tell me something, please? ...does the .dev stand for devious? deviant? devilish? devoid? DEVOTEE? �what? ) Gracias
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scroll bar missing on Windows PC's?