Forums / Addon Sideboxes / Cant get mousover to work in custom sidebox

Cant get mousover to work in custom sidebox

Started by creff on 10 Oct 2013, 8:35 PM · Views: 1,566

Results 1 to 3 of 3
10 Oct 2013, 8:35 PM
#1
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Cant get mousover to work in custom sidebox

Help please, site is https://www.halloweenfunshop.com/index.php (I have a temp site in index.html) and I created my own sidebox named Coupon on the upper left.

I have the following code in the includes/templates/responsive_apparel_boutique/sideboxes/tpl_coupon_sidebox.php:

<?php $content = '<div> <a href="coupon.html"> <img src="images/storecoupon2.jpg" onmouseover="this.src='images/storecouponroll2.jpg'" onmouseout=" this.src='images/storecoupon2.jpg'"></a> </div>' ?>

Why doesnt this work? If I remove the mouseover/outs it shows a single image with the link just fine. Im stumped on something really simple.

Thanks.

10 Oct 2013, 9:49 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Cant get mousover to work in custom sidebox

Mismatched quotation marks. You have single-quotes embedded inside another set of single-quotes, and thus they are not taking effect because they're being treated as the end of the string sooner than you intended. If you intend to embed single-quotes inside another set of single-quotes, you'll need to prepend a \ to "escape" them so they're treated as literal characters. This applies in all programming languages.

example: $var = 'this is a string of text which means I've gotta escape the quotes used inside it';
ie: if it starts and ends with single-quotes, then escape all single-quotes.
or, if it starts and ends with double-quotes, then escape all double-quotes.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Oct 2013, 10:15 PM
#3
creff avatar

creff

New Zenner

Join Date:
Oct 2008
Posts:
46
Plugin Contributions:
0

Re: Cant get mousover to work in custom sidebox

you da man. Thank you, worked perfectly.