H
henribaeyens
Hello,
I've come up with something weird while checking out a site with Opera 9
(latest version on XP). Tis an ecommerce site and in product pages what I
do is update some elements according to a given product's price and
options. So, when I pick an option, I change the display of the price to
show the option price and, if the product is out of stock, hide the buy
button and replace it with a message... See, for instance,
http://www.magellys.com/acatalog/Pantalons_hiver_hommes.html and go to
the second product, pick the size 40 and then the size 44... See what
this does? This works using jquery's html() function. And it works fine
on FF (linux and xp), on IE7, on Safari (windows version 3), but not in
Opera. In the latter, what happens is that, while the price div is
correctly overwritten, the add-to-cart-button div is overwritten AND
MOVED underneath the image (or, if you will, close to the top left corner
of the container div (which holds both the image and the product's info))
Here's the code that handles the add-to-cart-button div:
function enableadd(productref) {
html = '<table><tr>';
html += '<td style="padding-right: 0.75em;">Quantité:</td>';
html += '<td style="padding-right: 0.75em;"><input name="Q_' + productref + '" size="3" value="1" type="text"></td>';
html += '<td><input src="add_to_cart.gif" name="_' + productref + '" alt="Add to Cart" type="image"></td>';
html += '</tr></table>';
eval("abElements['"+productref+"'].html(html)");
}
function disableadd(productref) {
html = '<span style="font-size: 12pt; font-weight: bold; color: red;">Produit épuisé!</span>';
eval("abElements['"+productref+"'].html(html)");
}
The element containing the add-to-cart-button follows:
<div class="product_add" id="addbutton_<productcode>">
<table><tr>
<td style="padding-right: 0.75em;">Quantité:</td>
<td style="padding-right: 0.75em;"><input type="text" name="Q_<productcode>" size="3" value="1" /></td>
<td><input type="image" src="add_to_cart.gif" name="_<productcode>" alt="Add to Cart"/></td>
</tr></table>
</div>
<script type="text/javascript">
abElements["<productcode>"] = jQuery('div#addbutton_<productcode>');
</script>
Only the table is overwritten.
Has anyone come across a similar problem?
I've come up with something weird while checking out a site with Opera 9
(latest version on XP). Tis an ecommerce site and in product pages what I
do is update some elements according to a given product's price and
options. So, when I pick an option, I change the display of the price to
show the option price and, if the product is out of stock, hide the buy
button and replace it with a message... See, for instance,
http://www.magellys.com/acatalog/Pantalons_hiver_hommes.html and go to
the second product, pick the size 40 and then the size 44... See what
this does? This works using jquery's html() function. And it works fine
on FF (linux and xp), on IE7, on Safari (windows version 3), but not in
Opera. In the latter, what happens is that, while the price div is
correctly overwritten, the add-to-cart-button div is overwritten AND
MOVED underneath the image (or, if you will, close to the top left corner
of the container div (which holds both the image and the product's info))
Here's the code that handles the add-to-cart-button div:
function enableadd(productref) {
html = '<table><tr>';
html += '<td style="padding-right: 0.75em;">Quantité:</td>';
html += '<td style="padding-right: 0.75em;"><input name="Q_' + productref + '" size="3" value="1" type="text"></td>';
html += '<td><input src="add_to_cart.gif" name="_' + productref + '" alt="Add to Cart" type="image"></td>';
html += '</tr></table>';
eval("abElements['"+productref+"'].html(html)");
}
function disableadd(productref) {
html = '<span style="font-size: 12pt; font-weight: bold; color: red;">Produit épuisé!</span>';
eval("abElements['"+productref+"'].html(html)");
}
The element containing the add-to-cart-button follows:
<div class="product_add" id="addbutton_<productcode>">
<table><tr>
<td style="padding-right: 0.75em;">Quantité:</td>
<td style="padding-right: 0.75em;"><input type="text" name="Q_<productcode>" size="3" value="1" /></td>
<td><input type="image" src="add_to_cart.gif" name="_<productcode>" alt="Add to Cart"/></td>
</tr></table>
</div>
<script type="text/javascript">
abElements["<productcode>"] = jQuery('div#addbutton_<productcode>');
</script>
Only the table is overwritten.
Has anyone come across a similar problem?