Deanna475
01-29-2003, 07:01 AM
While I didn't write this code, the person who did appears to be unable to help me any further and I'm also stumped as to how to debug what I have so far.
Purpose of the script: The easiest way to describe this is to actually
go to the page in question. (http://www.theinspirationgallery.com/neo/neoclassic_border_test.htm)
What I am trying to accomplish is this: Hide the border across the top when a visitor clicks the "Hide Border" button, and restore the last border selected by the visitor when the "Restore Border" button is clicked. The easy part was getting the border to hide. I'm having troubles getting the last selected border to restore.
This is the code I was given to use on the parent page:
<SCRIPT LANGUAGE=JavaScript type="text/JavaScript">
function setBorder(borderImage) {
// sets passed border or sets default if none passed
if (borderImage=="") borderImage=defaultBorder;
currentBorder = borderImage; // saves selected border
document.getElementById("border").background = borderImage;
}
</SCRIPT>
And this is what the code is for the button that is supposed to restore the graphic after it has been hidden:
<FORM><INPUT CLASS="css2" TYPE="button" VALUE="Restore Border" onFocus="if(this.blur)this.blur()" onClick="border.background=currentBorder"></FORM>
This may be more information than is needed, but I'm going to point it out in case it is important:
This is the code I was given to swap the borders in the iframe page (and it works fine, so there's probably no need to mess with it?):
<SCRIPT LANGUAGE=JavaScript type="text/JavaScript">
defaultBorder="column07_default_bord.gif";
parent.currentBorder=defaultBorder;
function setBorder(border) {
// sets passed border or set default if none passed
if (border=="") border=defaultBorder;
parent.currentBorder = border; // save selected border
top.border.background = border;
}
</SCRIPT>
And this is how the border link is coded to call that function:
<a href="javascript:void(null)" onClick="return setBorder('bord_acanthus/neo_bord_acanthus_001.jpg')"
onmouseover="window.status='acanthus_001.jpg (13 KB)';return true" onmouseout="window.status='';return true">
<IMG SRC="bord_acanthus/neo_bord_acanthus_001_tn.jpg" BORDER=0 HEIGHT=60 WIDTH=90></a>
I would be grateful if someone can help me sort this out as it is the last JS bug I have to deal with and then I can move forward with my project on matters I know something about.
BTW, did I mention the extent of my JavaScript knowledge goes about as far as copying and pasting what people tell me to? *S* If left on my own to figure out "Does this go here? What about this? Do I still need this part?" etc., then I'm dangerous! *S* So if you find yourself having to spoonfeed me or spell it out exactly as I should be copying and pasting, then that would be why. *S*
Please and thank you.
Purpose of the script: The easiest way to describe this is to actually
go to the page in question. (http://www.theinspirationgallery.com/neo/neoclassic_border_test.htm)
What I am trying to accomplish is this: Hide the border across the top when a visitor clicks the "Hide Border" button, and restore the last border selected by the visitor when the "Restore Border" button is clicked. The easy part was getting the border to hide. I'm having troubles getting the last selected border to restore.
This is the code I was given to use on the parent page:
<SCRIPT LANGUAGE=JavaScript type="text/JavaScript">
function setBorder(borderImage) {
// sets passed border or sets default if none passed
if (borderImage=="") borderImage=defaultBorder;
currentBorder = borderImage; // saves selected border
document.getElementById("border").background = borderImage;
}
</SCRIPT>
And this is what the code is for the button that is supposed to restore the graphic after it has been hidden:
<FORM><INPUT CLASS="css2" TYPE="button" VALUE="Restore Border" onFocus="if(this.blur)this.blur()" onClick="border.background=currentBorder"></FORM>
This may be more information than is needed, but I'm going to point it out in case it is important:
This is the code I was given to swap the borders in the iframe page (and it works fine, so there's probably no need to mess with it?):
<SCRIPT LANGUAGE=JavaScript type="text/JavaScript">
defaultBorder="column07_default_bord.gif";
parent.currentBorder=defaultBorder;
function setBorder(border) {
// sets passed border or set default if none passed
if (border=="") border=defaultBorder;
parent.currentBorder = border; // save selected border
top.border.background = border;
}
</SCRIPT>
And this is how the border link is coded to call that function:
<a href="javascript:void(null)" onClick="return setBorder('bord_acanthus/neo_bord_acanthus_001.jpg')"
onmouseover="window.status='acanthus_001.jpg (13 KB)';return true" onmouseout="window.status='';return true">
<IMG SRC="bord_acanthus/neo_bord_acanthus_001_tn.jpg" BORDER=0 HEIGHT=60 WIDTH=90></a>
I would be grateful if someone can help me sort this out as it is the last JS bug I have to deal with and then I can move forward with my project on matters I know something about.
BTW, did I mention the extent of my JavaScript knowledge goes about as far as copying and pasting what people tell me to? *S* If left on my own to figure out "Does this go here? What about this? Do I still need this part?" etc., then I'm dangerous! *S* So if you find yourself having to spoonfeed me or spell it out exactly as I should be copying and pasting, then that would be why. *S*
Please and thank you.