Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Image Swap

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-16-2007, 08:33 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Image Swap

I would like to do an image swap on my products page for my buy now button. Anyone know how to do this. I keep getting a php tag error when I put javaScript in the home.tpl file. It also slows the page load way down. I tried calling it from an external file but it was still slooooow and the swap did not work.
__________________
xcart 5.1.2
Reply With Quote
  #2  
Old 09-17-2007, 09:13 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Image Swap

Anyone? I have a really sweet orange button I want to use with my really sweet blue button!!!
__________________
xcart 5.1.2
Reply With Quote
  #3  
Old 09-17-2007, 10:11 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Image Swap

Just use onmouseover/onmouseout to call different classes in CSS
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 09-17-2007, 10:50 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Image Swap

man...

I added this to the product.tpl

<td align="center" width="200px" height="37px" onmouseover="this.class.name='atcButton2'" onmouseout="this.class.name='atcButton1'"><A href="javascript: document.orderform.submit();">Add to Cart</a></td>

and this to my css file

td.atcButton1{
background:#ffffff url(images/atcButton.gif) no-Repeat;

}
td.atcButton2{
background:#ffffff url(images/atcButton2.gif) no-Repeat;
}

I even tried it with an internal style and nothing... am I calling it right?
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 09-17-2007, 12:15 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Image Swap

ended up using this....

<tr>
<td align="center"><a href="javascript: document.orderform.submit();"
onmouseover="document.atcButton.src='skin1/images/atcButton2.gif';"
onmouseout="document.atcButton.src='skin1/images/atcButton.gif';">
<img name="atcButton" src="skin1/images/atcButton.gif" width="200px" height="37px" />
</a>
</td>
</tr>
__________________
xcart 5.1.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:09 PM.

   

 
X-Cart forums © 2001-2020