I have this script running on a page (inline):
<script type="text/javascript">
var on="block";
var off="none";
var x1=x2=x3=off;
function showDescription()
{
if (x==1)
{
document.getElementById("desc1").style...
}
else if (x==2)
{
document.getElementById("desc2").style...
}
else if (x==3)
{
document.getElementById("desc3").style...
}
x1=x2=x3=off;
}
</script>
I have these links:
<a href="#description" onclick="showDescript(x1=on); return false;"><img src="../TKF/temp.jpg" border="0"></a>
<a href="#description" onclick="showDescript(x2=on); return false;"><img src="../TKF/temp.jpg" border="0"></a>
<a href="#description" onclick="showDescript(x3=on); return false;"><img src="../TKF/temp.jpg" border="0"></a>
Those links link to these <div>s:
<div id="desc1" class="description">
<!-- HIDDEN CONTENT (until selected from thumbnail) -->
<img src="../TKF/red.jpg" align="right">
Fabric type: Gingham
<p>
Machine washable
<p>
S,M,L - $50
<p>
<!--Shopping Cart Product Begin-->
<p><form NAME=order>
Quantity:
<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.val... value="1">
<input type=hidden name="PRICE" value="19.95">
<input type=hidden name="NAME" value="Long Cloak - Red">
<input type=hidden name="ID_NUM" value="1001">
<input type=hidden name="SHIPPING" value="5.95">
<p>
Select a size:
<select name=ADDITIONALINFO2>
<option value="Small"> Small
<option value="Medium"> Medium
<option value="Large">Large
</select>
<input type="button" value=' Add to Cart ' onClick='AddToCart(this.form)'>
<a href="Cart.html">View Cart</a>
</form>
<!--Shopping Cart Product End -->
</div>
<div id="desc2" class="description">
<!-- HIDDEN CONTENT (until selected from thumbnail) -->
<img src="../TKF/grey.jpg" align="right">
Fabric type: Gingham
<p>
Machine washable
<p>
S,M,L - $50
<p>
<!--Shopping Cart Product Begin-->
<p><form NAME=order>
Quantity:
<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.val... value="1">
<input type=hidden name="PRICE" value="19.95">
<input type=hidden name="NAME" value="Long Cloak - Red">
<input type=hidden name="ID_NUM" value="1001">
<input type=hidden name="SHIPPING" value="5.95">
<p>
Select a size:
<select name=ADDITIONALINFO2>
<option value="Small"> Small
<option value="Medium"> Medium
<option value="Large">Large
</select>
<input type="button" value=' Add to Cart ' onClick='AddToCart(this.form)'>
<a href="Cart.html">View Cart</a>
</form>
<!--Shopping Cart Product End -->
</div>
<div id="desc3" class="description">
<!-- HIDDEN CONTENT (until selected from thumbnail) -->
<img src="../TKF/black.jpg" align="right">
Fabric type: Gingham
<p>
Machine washable
<p>
S,M,L - $50
<p>
<!--Shopping Cart Product Begin-->
<p><form NAME=order>
Quantity:
<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.val... value="1">
<input type=hidden name="PRICE" value="19.95">
<input type=hidden name="NAME" value="Long Cloak - Red">
<input type=hidden name="ID_NUM" value="1001">
<input type=hidden name="SHIPPING" value="5.95">
<p>
Select a size:
<select name=ADDITIONALINFO2>
<option value="Small"> Small
<option value="Medium"> Medium
<option value="Large">Large
</select>
<input type="button" value=' Add to Cart ' onClick='AddToCart(this.form)'>
<a href="Cart.html">View Cart</a>
</form>
<!--Shopping Cart Product End -->
</div>
I know nothing about javascript, I merely used what someone told me to do. It doesn't work however, and any advice would be greatly appriciated. The idea is to have each link open in the same spot and replace any link that might already be open. Thank you so much!
Tags: