lowmarklow
05-13-2010, 10:12 AM
Hi Guys,
Was just wondering if you could help me out here!
If you refer to the Javascript code below, how can I set it so it shows a default Div layer upon page load?
<script type="text/javascript">
window.onload = function(){
if(location.href.indexOf('layer=') != -1)
if(document.getElementById(location.href.split('layer=')[1]))
document.getElementById(location.href.split('layer=')[1]).style.display = 'block';
}
</script>
Right, that's the Javascript and below is the Div layer it would select, for example I'm using the first layer of five:
<div id="one" style="display:none;">
</div>
On page load, all Div layers are hidden as they feature the display:none style, seen in the above example. Is there a way of selecting a default Div so it doesn't just show a blank page?
This is the page:
http://www.british-certification.com/iso-9001-certification.htm
By the way, I don't want to just link straight to the layer like this:
http://www.british-certification.com/iso-9001-certification.htm?layer=one
Thanks!
Mark
Was just wondering if you could help me out here!
If you refer to the Javascript code below, how can I set it so it shows a default Div layer upon page load?
<script type="text/javascript">
window.onload = function(){
if(location.href.indexOf('layer=') != -1)
if(document.getElementById(location.href.split('layer=')[1]))
document.getElementById(location.href.split('layer=')[1]).style.display = 'block';
}
</script>
Right, that's the Javascript and below is the Div layer it would select, for example I'm using the first layer of five:
<div id="one" style="display:none;">
</div>
On page load, all Div layers are hidden as they feature the display:none style, seen in the above example. Is there a way of selecting a default Div so it doesn't just show a blank page?
This is the page:
http://www.british-certification.com/iso-9001-certification.htm
By the way, I don't want to just link straight to the layer like this:
http://www.british-certification.com/iso-9001-certification.htm?layer=one
Thanks!
Mark