Guest User

ky

a guest
Feb 17th, 2010
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. <link rel="stylesheet" href="{$base_dir}modules/homefeatured/style.css" type="text/css" media="screen" />
  2. {literal}
  3. <script type="text/javascript">
  4. $(document).ready(function() {
  5.  
  6. //Show Banner
  7. $(".main_image .desc").show(); //Show Banner
  8. $(".main_image .bloc").animate({ opacity: 0.85 }, 1 ); //Set Opacity
  9.  
  10. //Click and Hover events for thumbnail list
  11. $(".image_thumb ul li:first").addClass('active');
  12. $(".image_thumb ul li").click(function(){
  13. //Set Variables
  14. var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
  15. var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
  16. var imgDesc = $(this).find('.bloc').html(); //Get HTML of block
  17. var imgDescHeight = $(".main_image").find('.bloc').height(); //Calculate height of block
  18.  
  19. if ($(this).is(".active")) { //If it's already active, then...
  20. return false; // Don't click through
  21. } else {
  22. //Animate the Teaser
  23. $(".main_image .bloc").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
  24. $(".main_image .bloc").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
  25. $(".main_image img").attr({ src: imgTitle , alt: imgAlt});
  26. });
  27. }
  28.  
  29. $(".image_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
  30. $(this).addClass('active'); //add class of 'active' on this list only
  31. return false;
  32.  
  33. }) .hover(function(){
  34. $(this).addClass('hover');
  35. }, function() {
  36. $(this).removeClass('hover');
  37. });
  38.  
  39. //Toggle Teaser
  40. $("a.collapse").click(function(){
  41. $(".main_image .bloc").slideToggle();
  42. $("a.collapse").toggleClass("show");
  43. });
  44.  
  45. });//Close Function
  46. </script>
  47. {/literal}
  48. <div id="main" class="container">
  49. <div class="image_thumb">
  50. <ul>
  51. {foreach from=$products item=product name=homeFeaturedProducts}
  52. {assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}
  53. <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}first_item_of_line{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
  54. <a href="{$img_prod_dir}{$product.id_image}-large.jpg"><img src="{$img_prod_dir}{$product.id_image}-small.jpg" alt="{$product.legend|escape:htmlall:'UTF-8'}"/></a>
  55. <div class="desc">
  56. <div class="bloc">
  57. <h5><a href="{$productLink}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{$product.name|escape:htmlall:'UTF-8'|truncate:30}</a></h5>
  58. <a href="{$product.link}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{$product.description_short|strip_tags|truncate:60:'...'}</a>
  59. <small>{displayWtPrice p=$product.price}</small>
  60. <p><a href="{$product.link}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{l s='view it' mod='homefeatured'}</a></p>
  61.  
  62. </div>
  63. </div>
  64. </li>
  65. {/foreach}
  66. </ul>
  67. </div>
  68.  
  69. <div class="main_image">
  70. {foreach from=$products item=product name=homeFeaturedProducts}
  71. {assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}
  72. <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}first_item_of_line{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
  73. <img src="{$img_prod_dir}{$product.id_image}-large.jpg" width="300" height="300" alt="{$product.legend|escape:htmlall:'UTF-8'}"/>
  74. <div class="desc">
  75. <div class="bloc">
  76. <h5><a href="{$productLink}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{$product.name|escape:htmlall:'UTF-8'|truncate:30}</a></h5>
  77. <a href="{$product.link}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{$product.description_short|strip_tags|truncate:60:'...'}</a>
  78. <small>{displayWtPrice p=$product.price}</small>
  79. <p><a href="{$product.link}" title="{$product.name|escape:htmlall:'UTF-8'|truncate:20}">{l s='view it' mod='homefeatured'}</a></p>
  80.  
  81. </div>
  82. </div>
  83. </li>
  84. {/foreach}
  85. </div>
  86. </div>
Advertisement
Add Comment
Please, Sign In to add comment