473,385 Members | 2,014 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,385 software developers and data experts.

problem with layers

Jay
http://www.wanganui.govt.nz/news/commsLink/index.asp

When viewed with Firefox.
The show/hide function doesn't work as expected (evident when viewed).
Anyone know why? Which bit is FF not liking and how can it be altered to be
cross browser friendly?

Jay
Jul 23 '05 #1
4 1236
Jay wrote:
http://www.wanganui.govt.nz/news/commsLink/index.asp

When viewed with Firefox.
The show/hide function doesn't work as expected (evident when viewed).
Anyone know why? Which bit is FF not liking and how can it be altered to be
cross browser friendly?

Jay

Not srue, but perhaps try

instead of ".style.overflow='hidden'"

try ".display='none'" (vs 'block')

--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--
Jul 23 '05 #2
Jay wrote:
http://www.wanganui.govt.nz/news/commsLink/index.asp

When viewed with Firefox.
The show/hide function doesn't work as expected (evident when viewed).
Anyone know why? Which bit is FF not liking and how can it be altered to be
cross browser friendly?


It is better to have the hidden <li> elements shown by default and
use JavaScript to hide them when the page loads. That way you don't
need a separate link for non-JavaScript browsers.

At the same time, you could assign the onclick function to each li,
saving some code.

The easy (for you) fix is to use:

...style.display = 'none'

to hide the links, and ...style.display ='' to show them again.

Another tip is to use one function to toggle between show and hide,
rather than have a separate link to do it. I've created a
dependency between the <span> and the ULs that are hidden based on
the id.

A re-write of a snipped below to show how to do some of the above,

<script type="text/javascript">
function initLinks(){
// Hide all the ULs
var base = document.getElementById('links');
var ul = base.getElementsByTagName('ul');
var i = ul.length;
while (i--){
ul[i].style.display = 'none';
}
// Add onclick to spans
var sp = base.getElementsByTagName('span');
i = sp.length;
while (i--) {
if ( sp[i].className && 'greyBack' == sp[i].className ) {
sp[i].onclick = function() {showLinks(this)};
}
}
}
function showLinks(x){
x = x.id.split('-')[1];
x=document.getElementById(x);
x.style.display = (x.style.display == '')? 'none':'';
}
window.onload = initLinks;
</script>

<div id="links">
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-191TO200" class="greyBack">Issues 191-200 </span>
<br>
<ul id="191TO200">
<li><a href="issue200.asp" >Issue #200</a> 2nd April 2005</li>
<li><a href="issue199.asp" >Issue #199</a> 26th March 2005</li>
<li><a href="issue191.asp" >Issue #191</a> 29th January 2005</li>
</ul>
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-181TO190" class="greyBack">Issues 181-190 </span>
<br>
<ul id="181TO190">
<li><a href="issue190.asp" >Issue #190</a> 2nd April 2005</li>
<li><a href="issue189.asp" >Issue #189</a> 26th March 2005</li>
<li><a href="issue181.asp" >Issue #181</a> 29th January 2005</li>
</ul>
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-171TO180" class="greyBack">Issues 171-180 </span>
<br>
<ul id="171TO180">
<li><a href="issue180.asp" >Issue #180</a> 2nd April 2005</li>
<li><a href="issue179.asp" >Issue #179</a> 26th March 2005</li>
<li><a href="issue171.asp" >Issue #171</a> 29th January 2005</li>
</ul>
</div>
Jul 23 '05 #3
cool

--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--

Jay wrote:
http://www.wanganui.govt.nz/news/commsLink/index.asp

When viewed with Firefox.
The show/hide function doesn't work as expected (evident when viewed).
Anyone know why? Which bit is FF not liking and how can it be altered to be
cross browser friendly?

Jay

cool

--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--
Jul 23 '05 #4
Jay

"RobG" <rg***@iinet.net.auau> wrote in message
news:42***********************@per-qv1-newsreader-01.iinet.net.au...
Jay wrote:
http://www.wanganui.govt.nz/news/commsLink/index.asp

When viewed with Firefox.
The show/hide function doesn't work as expected (evident when viewed).
Anyone know why? Which bit is FF not liking and how can it be altered to
be cross browser friendly?

It is better to have the hidden <li> elements shown by default and
use JavaScript to hide them when the page loads. That way you don't
need a separate link for non-JavaScript browsers.

At the same time, you could assign the onclick function to each li,
saving some code.

The easy (for you) fix is to use:

...style.display = 'none'

to hide the links, and ...style.display ='' to show them again.

Another tip is to use one function to toggle between show and hide,
rather than have a separate link to do it. I've created a
dependency between the <span> and the ULs that are hidden based on
the id.

A re-write of a snipped below to show how to do some of the above,


I've used your suggesting below and it works perfectly!
(still on the Dev box at the moment)

Many thanks

Jay

<script type="text/javascript">
function initLinks(){
// Hide all the ULs
var base = document.getElementById('links');
var ul = base.getElementsByTagName('ul');
var i = ul.length;
while (i--){
ul[i].style.display = 'none';
}
// Add onclick to spans
var sp = base.getElementsByTagName('span');
i = sp.length;
while (i--) {
if ( sp[i].className && 'greyBack' == sp[i].className ) {
sp[i].onclick = function() {showLinks(this)};
}
}
}
function showLinks(x){
x = x.id.split('-')[1];
x=document.getElementById(x);
x.style.display = (x.style.display == '')? 'none':'';
}
window.onload = initLinks;
</script>

<div id="links">
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-191TO200" class="greyBack">Issues 191-200 </span>
<br>
<ul id="191TO200">
<li><a href="issue200.asp" >Issue #200</a> 2nd April 2005</li>
<li><a href="issue199.asp" >Issue #199</a> 26th March 2005</li>
<li><a href="issue191.asp" >Issue #191</a> 29th January 2005</li>
</ul>
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-181TO190" class="greyBack">Issues 181-190 </span>
<br>
<ul id="181TO190">
<li><a href="issue190.asp" >Issue #190</a> 2nd April 2005</li>
<li><a href="issue189.asp" >Issue #189</a> 26th March 2005</li>
<li><a href="issue181.asp" >Issue #181</a> 29th January 2005</li>
</ul>
<img align="absmiddle" hspace="5" src="images/expandIssues.gif">
<span id="s-171TO180" class="greyBack">Issues 171-180 </span>
<br>
<ul id="171TO180">
<li><a href="issue180.asp" >Issue #180</a> 2nd April 2005</li>
<li><a href="issue179.asp" >Issue #179</a> 26th March 2005</li>
<li><a href="issue171.asp" >Issue #171</a> 29th January 2005</li>
</ul>
</div>

Jul 23 '05 #5

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

Similar topics

1
by: Lizzy | last post by:
I have an internet application which has a progress bar show whenever the customer is requesting data from the server. This progress bar is coded to work in both Netscape 4.75 and above and IE 5.0...
4
by: Federico Bari | last post by:
Good morning all from italy, i have probably a compatibility problem with a html/javascript page. The aim of the code of the file test.htm you find here following (copy the 3 files in the...
8
by: Freek te Water | last post by:
Hi, Hope no-one is offended by my probably noob question... Context: I have a web page design, which always centres in the middle of the screen (using a 100%*100% HTML-table). Now I also use...
6
by: GD | last post by:
I'm using a script that works great on IE, but not on mozilla. the original one worked also on N4, but i'd like it to be funcional with mozilla. this is the orginal script: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
14
by: Bryan | last post by:
I am attempting to make a web page more Netscape friendly... <a href="http:www.gordonceilings.com"></a> I have already corrected the table issues in an offline staging site (where I do the...
1
by: HoDeHoo | last post by:
Hi there, This may be more of an HTML problem than a PHP problem but as I am a beginnger at both I hope you will spare some compassion! I was up till 4 am last night and spent a solid 6 hours...
4
by: Frank | last post by:
I am developing with VS.NET 2003 on the ASP.NET 1.1 platform. I have created a small app that interacts with an existing Access 97 db. At this point in time, my higher ups are unwilling to...
3
by: Mark Szlazak | last post by:
The following page simulates a pool cue and cue ball: http://members.aol.com/myscript/cue.html Mouse cursor position around the cue ball determines where a roll-over of 179 pool cue images is...
1
by: Kevin R | last post by:
This is one of the weirdest problems I have ever run into. I have had to trim down a bunch of code to give a sample that is more easily readable by those who will view this. Here is the problem:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.