index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <div class="model-1">
  2. <div class="adv-wrapper" data-type="{$config_info.show_format|default='0'}" style="background-color:{$config_info.back_color|default='unset'};">
  3. {if isset($config_info['adv']) && !empty($config_info['adv'])}
  4. <div class="bd">
  5. {foreach name="config_info.adv" item="v"}
  6. <img src="{$v.image}" style="width:100%;" data-width="{:floatval(isset($config_info['image_width'])?$config_info['image_width']:0)}" data-height="{:floatval(isset($config_info['image_height'])?$config_info['image_height']:0)}" />
  7. {/foreach}
  8. </div>
  9. {if count($config_info['adv'])>1}
  10. <div class="hd">
  11. {foreach name="config_info.adv" item="v"}
  12. <div class="li"></div>
  13. {/foreach}
  14. </div>
  15. {/if}
  16. {else}
  17. <div class="bd">
  18. <img src="{:goods_thumb()}" style="width:100%;" data-width="{:floatval(isset($config_info['image_width'])?$config_info['image_width']:0)}" data-height="{:floatval(isset($config_info['image_height'])?$config_info['image_height']:0)}" />
  19. </div>
  20. {/if}
  21. </div>
  22. </div>
  23. <script>
  24. if(typeof(loadHtml1)=='undefined'){
  25. function loadHtml1(obj){
  26. var w=parseFloat(obj.find('img').eq(0).attr('data-width'));
  27. var h=parseFloat(obj.find('img').eq(0).attr('data-height'));
  28. if(isNaN(w) || w<=0){
  29. w=750
  30. }
  31. if(isNaN(h) || h<=0){
  32. h=376
  33. }
  34. obj.find('img').css('height',(h/w*obj.width())+'px')
  35. if(obj.find('img').length>1){
  36. if(obj.find('.adv-wrapper').attr('data-type')=='1'){
  37. obj.find('.adv-wrapper').slide({titCell:".hd",mainCell: ".bd",autoPage:true, autoPlay: true,effect:"topLoop"})
  38. }else{
  39. obj.find('.adv-wrapper').slide({titCell:".hd",mainCell: ".bd",autoPage:true, autoPlay: true,effect:"leftLoop"})
  40. }
  41. }
  42. }
  43. }
  44. </script>