Tooltips problem, making this javascript work with my smarty foreach loop, help pelase!
Posted
by Kyle Sevenoaks
on Stack Overflow
See other posts from Stack Overflow
or by Kyle Sevenoaks
Published on 2010-03-12T09:24:50Z
Indexed on
2010/03/12
9:27 UTC
Read the original article
Hit count: 253
I am using an example of tooltips from http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm on www.euroworker.no/order
I have this code here to work with, but it just doesn't seem to work correctly, I've tried everything I can think of (not a lot of things)
Here's the code.
{foreach from=$cart.cartItems item="item" name="cart"}
<div class="{zebra loop="cart"}">
<div id="sgproductview">
<div id="cart2Varekode">
<p>
{if $product.sku}
<span class="param">{$item.product.sku}</span>
{else}
<span>{img src=$item.Product.DefaultImage.paths.1 alt=$item.Product.name_lang|escape}</span>
{/if}
</p>
</div>
<div id="cart2Produkt">
<p>{if $item.Product.ID}
<a href="{productUrl product=$item.Product}" data-tooltip="sticky{$smarty.foreach.cart.iteration}" target="_blank">{$item.Product.name_lang|truncate:20}</a>
{else}
<span>{$item.Product.name_lang|truncate:20}</span>
</a>
{/if}
</p>
<p>
{include file="order/itemVariations.tpl"}
{include file="order/block/itemOptions.tpl"}
{if $multi}
{include file="order/selectItemAddress.tpl" item=$item}
{/if}
</p>
</div>
{if $item.Product.DefaultImage.paths.3}
<div id="mystickytooltip" class="stickytooltip">
<div style="padding:5px;">
<div id="sticky1" class="atip" style="width:200px;">
<img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br>
{$item.Product.name_lang}
</div>
<div id="sticky2" class="atip" style="width:200px;">
<img src={$item.Product.DefaultImage.paths.3} alt="{$item.Product.name_lang|escape}"><br>
{$item.formattedPrice}
</div>
<div id="sticky3" class="atip" style="width:200px;">
<img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br>
{$item.Product.name_lang}PRODUCT 3
</div>
<div id="sticky4" class="atip" style="width:200px;">
<img src="{$item.Product.DefaultImage.paths.3}" alt="{$item.Product.name_lang|escape}"><br>
{$item.Product.name_lang}
</div>
</div>
</div>
{/if}
<div id="cart2Price">
<p class="actualPrice">
{$item.formattedPrice}
</p>
</div>
<div id="salg"></div>
<div id="cart2Salg">
<p></p>
</div>
<div id="antallbox">
<p class="cartQuant">
{textfield name="item_`$item.ID`" class="text"}
</p>
</div>
<div id="cart2Total">
<p>
{if $item.count == 1}
<span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span>
{else}
{$item.formattedDisplaySubTotal}
<div class="subTotalCalc">
{$item.count} x <span class="basePrice">{$item.formattedBasePrice}</span><span class="actualPrice">{$item.formattedPrice}</span>
</div>
{/if}
</p>
</div>
<div id="delete">
{if 'ENABLE_WISHLISTS'|config}
<a href="{link controller=order action=moveToWishList id=$item.ID query="return=`$return`"}">{t _move_to_wishlist}</a>
{/if}
<a id="slett" href="{link controller=order action=delete id=$item.ID query="return=`$return`"}" title="Slett"><!--{t _remove}--></a>
</div>
</div>
</div>
{/foreach}
Anyone can help? {html_image} doesn't work, by the way and all the extensions are present and correct.
© Stack Overflow or respective owner