Forums

This topic is locked

Rollover images on Repeat Regions Dont work

Posted 18 Jun 2003 03:23:49
1
has voted
18 Jun 2003 03:23:49 andre andre posted:
Rollover images on Repeat Regions Dont work Does anyone know Why If so help !!

Replies

Replied 18 Jun 2003 08:30:47
18 Jun 2003 08:30:47 emma macdougall replied:
This will be very intresting for i have the same problem first image appears second image nothing.
Emma xxx
Replied 18 Jun 2003 11:59:53
18 Jun 2003 11:59:53 Vince Baker replied:
Can you post your code so I can take a look.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 18 Jun 2003 22:54:18
18 Jun 2003 22:54:18 andre andre replied:
Quote
Rollover images on Repeat Regions Dont work Does anyone know Why If so help !!

<pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include file="Connections/dbconn.asp" --&gt;
&lt;%
Dim rsproducts__MMColParam
rsproducts__MMColParam = "Rags,Towels,Sponges"
If (Request("MM_EmptyValue" &lt;&gt; "" Then
rsproducts__MMColParam = Request("MM_EmptyValue"
End If
%&gt;
&lt;%
Dim rsproducts
Dim rsproducts_numRows

Set rsproducts = Server.CreateObject("ADODB.Recordset"
rsproducts.ActiveConnection = MM_dbconn_STRING
rsproducts.Source = "SELECT * FROM Products WHERE CategoryName = '" + Replace(rsproducts__MMColParam, "'", "''" + "'"
rsproducts.CursorType = 2
rsproducts.CursorLocation = 2
rsproducts.LockType = 1
rsproducts.Open()

rsproducts_numRows = 0
%&gt;
&lt;%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
rsproducts_numRows = rsproducts_numRows + Repeat1__numRows
%&gt;
&lt;%
Dim MM_paramName
%&gt;
&lt;%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName &lt;&gt; "" Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth &lt;&gt; "" Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL &lt;&gt; "" Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm &lt;&gt; "" Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem &lt;&gt; "" Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Cleaning supplies&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;script language="JavaScript" type="text/JavaScript"&gt;
&lt;!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i&lt;a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i&lt;a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")&gt;0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i&lt;d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i&lt;d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i&lt;(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body bgcolor="#FFFFFF" text="#000000" link="#FF0000" leftmargin="10" topmargin="1" marginwidth="1" marginheight="1" onLoad="MM_preloadImages('images/cleaning-suppliesRB.gif','images/dryers&amp;extRB.gif','images/ddcleanersRB.gif','images/carpets&amp;uphRB.gif','images/part&amp;accRB.gif','images/ppeRB.gif','images/contain&amp;flitersRB.gif','images/pack&amp;miscRB.gif','images/redbuttonRB.gif','images/addtocartRB.gif')"&gt;
&lt;table width="791" height="100%" border="0" cellpadding="0" cellspacing="0" id="outlinetable"&gt;
&lt;tr&gt;
&lt;td width="791" height="543" valign="top"&gt;
&lt;table width="100%" border="0" cellpadding="0" cellspacing="0" id="spacer"&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="575" border="0" cellpadding="0" cellspacing="0" id="navtabletop"&gt;
&lt;tr&gt;
&lt;td width="27" height="51&gt;&lt;a href=" align="right"#&gt;&lt;img src="images/topcorner.gif" width="27" height="51"&gt;&lt;/td&gt;
&lt;td width="71" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('cleaning supp','','images/cleaning-suppliesRB.gif',1)"&gt;&lt;a href="Cleaning_supplies.asp"&gt;&lt;img src="images/cleaning-supplies.gif" name="cleaning supp" width="71" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="68" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('dryer& ext','','images/dryers&extRB.gif',1)"&gt;&lt;a href="dryers&extractors.asp"&gt;&lt;img src="images/dryers&ext.gif" name="dryer& ext" width="68" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="69" height="51&gt;&lt;a href="#&gt;&lt;a href="ddcleaners.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ddcleaners','','images/ddcleanersRB.gif',1)"&gt;&lt;img src="images/ddcleaners.gif" name="ddcleaners" width="69" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="67" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('carpet&uph','','images/carpets&uphRB.gif',1)"&gt;&lt;a href="carpet%20and%20upholstery.asp"&gt;&lt;img src="images/carpets&uph.gif" name="carpet&uph" width="67" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="67" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('parts&acc','','images/part&accRB.gif',1)"&gt;&lt;a href="parts&acc.asp"&gt;&lt;img src="images/part&acc.gif" name="parts&acc" width="67" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="68" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ppe','','images/ppeRB.gif',1)"&gt;&lt;a href="PPE.asp"&gt;&lt;img src="images/ppe.gif" name="ppe" width="68" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="68" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contain&filters','','images/contain&flitersRB.gif',1)"&gt;&lt;a href="containment&filters.asp"&gt;&lt;img src="images/contain&fliters.gif" name="contain&filters" width="68" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="71" height="51&gt;&lt;a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('pack&misc','','images/pack&miscRB.gif',1)"&gt;&lt;a href="packing&misc.asp"&gt;&lt;img src="images/pack&misc.gif" name="pack&misc" width="71" height="51" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;a href="default.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('redbutton_home','','images/redbuttonRB.gif',1)"&gt;&lt;img src="images/redbutton.gif" alt="Home" name="redbutton_home" width="36" height="30" border="0" align="absmiddle"&gt;&lt;/a&gt;&lt;font color="#000066" size="2" face="Arial Narrow"&gt;Home&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="145" border="0" align="left" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="36"&gt;&lt;img src="images/button_ext.gif" width="36" height="19"&gt;&lt;/td&gt;
&lt;td width="109"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="36"&gt;&lt;a href="cleaning_supplies_402.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('rbdeodorizers','','images/redbuttonRB.gif',1)"&gt;&lt;img src="images/redbutton.gif" alt="Mopping &amp; Sweeping" name="rbdeodorizers" width="36" height="30" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="109"&gt;&lt;font color="#000066" size="2" face="Arial Narrow"&gt;Mopping
&amp; Sweeping&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="36"&gt;&lt;img src="images/button_ext.gif" width="36" height="19"&gt;&lt;/td&gt;
&lt;td width="109"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="cleaning_supplies_403.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bt3','','images/redbuttonRB.gif',1)"&gt;&lt;img src="images/redbutton.gif" alt="scrubbers" name="bt3" width="36" height="30" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="109"&gt;&lt;font color="#000066" size="2" face="Arial Narrow"&gt;Scrubbers&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="images/button_ext.gif" width="36" height="19"&gt;&lt;/td&gt;
&lt;td width="109"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="cleaning_supplies_404.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bt4','','images/redbuttonRB.gif',1)"&gt;&lt;img src="images/redbutton.gif" alt="Sprayers" name="bt4" width="36" height="30" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="109"&gt;&lt;font color="#000066" size="2" face="Arial Narrow"&gt;Sprayers&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="images/button_ext.gif" width="36" height="19"&gt;&lt;/td&gt;
&lt;td width="109"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="30"&gt;&lt;a href="cleaning_supplies_405.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bt5','','images/redbuttonRB.gif',1)"&gt;&lt;img src="images/redbutton.gif" name="bt5" width="36" height="30" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td width="109"&gt;&lt;font color="#000066" size="2" face="Arial Narrow"&gt;Buckets
&amp; Dispensers&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="100%" height="999%" border="0" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td width="75%" align="left" valign="top"&gt;&lt;table width="440" border="0" align="left" cellpadding="0" cellspacing="0"&gt;
&lt;tr&gt;
&lt;td height="30" align="left" valign="top"&gt;&lt;div align="center"&gt;&lt;font color="#000066" size="2" face="Arial, Helvetica, sans-serif"&gt;Rags,
Towels, Sponges&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="62%" height="42" valign="top"&gt; &lt;table width="485" height="127" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF"&gt;
&lt;%
While ((Repeat1__numRows &lt;&gt; 0) AND (NOT rsproducts.EOF))
%&gt;
&lt;tr bgcolor="#CCCCCC"&gt;
&lt;td width="1"&gt;&nbsp;&lt;/td&gt;
&lt;td width="36"&gt;&nbsp;&lt;/td&gt;
&lt;td width="50" height="10"&gt;&nbsp;&lt;/td&gt;
&lt;td width="150"&gt;&lt;div align="center"&gt;&lt;font color="#FFFFFF" size="1" face="Arial"&gt;&lt;strong&gt;DETAILS&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="40" bordercolor="#CCCCCC" bgcolor="#CCCCCC"&gt;
&lt;div align="center"&gt;&lt;font color="#FFFFFF" size="1" face="Arial"&gt;&lt;strong&gt;SIZE&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="60" bordercolor="#CCCCCC" bgcolor="#CCCCCC"&gt;
&lt;div align="center"&gt;&lt;font color="#FFFFFF" size="1" face="Arial"&gt;&lt;strong&gt;PRICE&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="150"&gt;&nbsp;&lt;/td&gt;
&lt;td width="8"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="1" bgcolor="#CCCCCC"&gt;&nbsp;&lt;/td&gt;
&lt;td width="36"&gt;&lt;img src="&lt;%=(rsproducts.Fields.Item("photo".Value)%&gt;"&gt;&lt;/td&gt;
&lt;td width="50" background="images/greygrid.gif"&gt;
&lt;div align="center"&gt;&lt;font color="#000066" size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(rsproducts.Fields.Item("ProductId".Value)%&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="150" background="images/greygrid.gif"&gt;
&lt;div align="center"&gt;&lt;font color="#000099" face="Arial, Helvetica, sans-serif"&gt;&lt;A HREF="Cleaning_sup_details.asp?&lt;%= MM_keepNone & MM_joinChar(MM_keepNone) & "ProductID=" & rsproducts.Fields.Item("ProductID".Value %&gt;"&gt;&lt;%=(rsproducts.Fields.Item("ProductName".Value)%&gt;&lt;/A&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="40" bgcolor="#FF0000"&gt;
&lt;div align="center"&gt;&lt;font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(rsproducts.Fields.Item("Size".Value)%&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="60" bgcolor="#FF0000"&gt;
&lt;div align="center"&gt;&lt;font color="#FFFFFF" size="-1" face="Arial, Helvetica, sans-serif"&gt;&lt;%= FormatCurrency((rsproducts.Fields.Item("UnitPrice".Value), -1, -2, -2, -2) %&gt;&lt;/font&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="150" align="center" valign="middle" background="images/greygrid.gif"&gt;&lt;a href="&lt;%=(rsproducts.Fields.Item("Cart link".Value)%&gt;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','images/addtocartRB.gif',1)"&gt;&lt;img src="images/addtocart.gif" alt="ADD TO CART" name="Image20" width="96" height="23" border="0"&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;td width="8" bgcolor="#CCCCCC"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsproducts.MoveNext()
Wend
%&gt;
&lt;tr bgcolor="#CCCCCC"&gt;
&lt;td width="1"&gt;&nbsp;&lt;/td&gt;
&lt;td width="36" height="10"&gt;&nbsp;&lt;/td&gt;
&lt;td width="50"&gt;&nbsp;&lt;/td&gt;
&lt;td width="150"&gt;&nbsp;&lt;/td&gt;
&lt;td width="40" bgcolor="#CCCCCC"&gt;&nbsp;&lt;/td&gt;
&lt;td width="60" bgcolor="#CCCCCC"&gt;&nbsp;&lt;/td&gt;
&lt;td width="150"&gt;&nbsp;&lt;/td&gt;
&lt;td width="8"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;/td&gt;
&lt;td width="24%"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsproducts.Close()
Set rsproducts = Nothing
%&gt;

Reply to this topic