Cant get mousover to work in custom sidebox
Help please, site is 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.
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.
Re: Cant get mousover to work in custom sidebox
you da man. Thank you, worked perfectly.