Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joezandstra

macrumors newbie
Original poster
Feb 27, 2006
2
0
Singapore
Hi,
I'm having a strange problem getting some simple code to work on Firefox (Mac). It works fine in Safari and all major PC browsers...

I have a hidden DIV that is full of scrolling content and I have set "overflow: auto" so that it scrolls within the div. The DIV hides fine on all browsers but Firefox where the scrollbar (but none of the content) displays.

I have searched everywhere online for an answer but can't seem to find any bugs reported about Firefox displaying the scrollbars of hidden DIVs. I expect there's something fundamental wrong with my code. I'd be very grateful for any pointers. Below is the code I'm having trouble with:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>

<style type="text/css">
<!--
.content {
color: white;
padding: 10px 10px 10px 10px;
height: 300px;
width: 300px;
visibility: hidden;
background-color: green;
overflow: auto;
}
-->
</style>

<script type="text/javascript">
<!--

function showhide(sublink) {

if(document.getElementById(sublink).style.visibility == 'hidden')
{
document.getElementById(sublink).style.visibility = 'visible';
}
else
{
document.getElementById(sublink).style.visibility = 'hidden';
}
}

// -->
</script>

<title>Mac Scrollbar Firefox Issue with hidden div, overflow: auto</title>
</head>
<body>

<a href="Javascript:showhide('divtest')">Click to show hidden div</a>

<div id="divtest" class="content" style="visibility: hidden;">
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac?? On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
On the PC (Firefox, Opera, IE) and Safari for the Mac, this div is hidden and the scrollbar is hidden too. How do I stop a disembodied scrollbar from appearing on Firefox for Mac??
</div>


</body>
</html>
 

Happyeyeball

macrumors newbie
Oct 19, 2006
1
0
Javascript / DHTML problem on Firefox Mac

Hi joezandstra,

Did you ever find a fix for this problem? I'm running into the same thing.

Many thanks, Jeffrey
 

joezandstra

macrumors newbie
Original poster
Feb 27, 2006
2
0
Singapore
Hi Jeffrey,
It was such a while back that I've forgotten exactly how I solved the issue - but I did - through trial and error - discover a workaround.

I believe it had something to do with the syntax of the styles in the head of the document paired with the visibility attribute for the DIV in the body... but it was a while ago and I'm no coder.

Best thing I can do is point you to the site I was building at the time:
(this is a preloader that redirects to the actual file)

http://www.joezandstra.com/index1.html

Good luck!

Joe
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.