J
John Doe
I have a webpage which shows and hides divs as a method of
navigation. It works great in the ever evil IE. It works not so
great (read not at all) in any standards compliant browser. I
haven't ever bothered with standards compliance type stuff before,
but am slowly converting. For now I just want to get things working
on standards compliant browsers, later I'll actually go fully
standards compliant for my web pages. Could someone give me an idea
of what the problem might be?
The function that shows a particular area of the site looks like this
(note that if not fed a value, it determines the section to display
based on an anchor in the url, a requirement for the content
management system that I am using):
<code>
function showBlog(bID) {
if(arguments.length == 0 ) {
bID=0;
if(document.location.hash != "") {
BID="item"+document.location.hash.substr(1);
for(i=0;i<myBlogs.length;i++){
if(myBlogs[0] == BID) {
bID=i;
}
}
}
}
if(bID < myBlogs.length) {
myBlogs[bID][1].style.display='block';
}
if(bID != 0) {
pBID = bID - 1;
myBlogs[bID][3].innerHTML="<< "+myBlogs[pBID][2];
} else {
myBlogs[bID][3].style.display='none';
}
if(bID != myBlogs.length-1) {
nBID = bID + 1;
myBlogs[bID][4].innerHTML=myBlogs[nBID][2]+" >>";
} else {
myBlogs[bID][4].style.display='none';
}
}
</code>
Throughout the page little snippets like the following appear which
define (as divs) the various sections to be manipulated:
<code>
<script>
myBlogs.push(["item000208",item000208,"Poetry Reading", plink000208,\
nlink000208]);
</script>
<div class="blogbody" id="item000204" style="display:none;">
</code>
Anyone who can help will be greatly appreciated.
navigation. It works great in the ever evil IE. It works not so
great (read not at all) in any standards compliant browser. I
haven't ever bothered with standards compliance type stuff before,
but am slowly converting. For now I just want to get things working
on standards compliant browsers, later I'll actually go fully
standards compliant for my web pages. Could someone give me an idea
of what the problem might be?
The function that shows a particular area of the site looks like this
(note that if not fed a value, it determines the section to display
based on an anchor in the url, a requirement for the content
management system that I am using):
<code>
function showBlog(bID) {
if(arguments.length == 0 ) {
bID=0;
if(document.location.hash != "") {
BID="item"+document.location.hash.substr(1);
for(i=0;i<myBlogs.length;i++){
if(myBlogs[0] == BID) {
bID=i;
}
}
}
}
if(bID < myBlogs.length) {
myBlogs[bID][1].style.display='block';
}
if(bID != 0) {
pBID = bID - 1;
myBlogs[bID][3].innerHTML="<< "+myBlogs[pBID][2];
} else {
myBlogs[bID][3].style.display='none';
}
if(bID != myBlogs.length-1) {
nBID = bID + 1;
myBlogs[bID][4].innerHTML=myBlogs[nBID][2]+" >>";
} else {
myBlogs[bID][4].style.display='none';
}
}
</code>
Throughout the page little snippets like the following appear which
define (as divs) the various sections to be manipulated:
<code>
<script>
myBlogs.push(["item000208",item000208,"Poetry Reading", plink000208,\
nlink000208]);
</script>
<div class="blogbody" id="item000204" style="display:none;">
</code>
Anyone who can help will be greatly appreciated.