dreamxgirl
10-21-2004, 11:41 PM
I hope no one has put a request like this in yet - I tried searching the forum, but couldn't find anything.. Apologies if there are.
Ok...
I have created a very basic (still learning!)CBL template using DreamWeaver. When complete, I want to share this with the other people in my group, so that they can make their own CBLs.. Everything is going well except for the navigation bar. I am wanting to create a next and previous button, where they can literally go back one page and forward one page etc.
So I come up with the following code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function go(prf) {
var text = self.location.href;
var pos = text.indexOf (prf);
var poslng = prf.length;
var num = text.substring(pos+poslng,pos+poslng+3) - 0 + dir;
num = (num < 10) ? "00" + num : ( (num < 100) ? "0" + num : num);
window.location.href = text.substring(0,pos+poslng) +
num +
text.substring(pos+poslng+3,text.length);
}
//-->
</SCRIPT>
From what I can tell - this should search dir with a number.
eg.
fire001.htm,
fire002.htm,
fire003.htm and lets it advance by following the numbers up to 999.
So - I am needing it to just follow the sequence in numbers, regardless of what the first letters of the cbl file is called.
Well.. it won't work.. Every time I view it in browser - nothing happens when I click on link. Why?
At the moment, I applied the template to fire001.htm and fire002.htm
The links on there are back and next (javascript:go(1) and javascript:go(-1)
Could someone please help me?? :confused:
Thanks!
Ok...
I have created a very basic (still learning!)CBL template using DreamWeaver. When complete, I want to share this with the other people in my group, so that they can make their own CBLs.. Everything is going well except for the navigation bar. I am wanting to create a next and previous button, where they can literally go back one page and forward one page etc.
So I come up with the following code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function go(prf) {
var text = self.location.href;
var pos = text.indexOf (prf);
var poslng = prf.length;
var num = text.substring(pos+poslng,pos+poslng+3) - 0 + dir;
num = (num < 10) ? "00" + num : ( (num < 100) ? "0" + num : num);
window.location.href = text.substring(0,pos+poslng) +
num +
text.substring(pos+poslng+3,text.length);
}
//-->
</SCRIPT>
From what I can tell - this should search dir with a number.
eg.
fire001.htm,
fire002.htm,
fire003.htm and lets it advance by following the numbers up to 999.
So - I am needing it to just follow the sequence in numbers, regardless of what the first letters of the cbl file is called.
Well.. it won't work.. Every time I view it in browser - nothing happens when I click on link. Why?
At the moment, I applied the template to fire001.htm and fire002.htm
The links on there are back and next (javascript:go(1) and javascript:go(-1)
Could someone please help me?? :confused:
Thanks!