ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์CMS & Free Scriptขอเซียน magento + widget อีกทีครับ
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: ขอเซียน magento + widget อีกทีครับ  (อ่าน 361 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
krite2010
สมุนแก๊งเสียว
*

พลังน้ำใจ: 6
ออฟไลน์ ออฟไลน์

กระทู้: 979



ดูรายละเอียด
« เมื่อ: 16 พฤศจิกายน 2011, 14:02:43 »

ไม่ทราบว่าจะใส่ code นี้ได้ที่ไหนดีครับ
 
โค๊ด:
<?php echo $this->helper('core/js')->includeSkinScript('js/jquery.nivo.slider.js'); ?>
<?php echo Mage::getBaseDir() . "js/jquery.nivo.slider.js" ?>

ถ้าจะไว้ใน banner.phtml ซึ่งอยู่ใน appdesignfrontenddefaultToys   emplatewidgetglideranner.phtml

จาก banner.phtml
โค๊ด:
<style>
.slideshow {
  position:relative;
}

.slideshow .items div {
  float:left;
  opacity:0.0;
  position:absolute;
  z-index:8;
}

.slideshow .items div.active {
  opacity:1.0;
  z-index:10;
}
</style>

<script>
function slideSwitch() {
  var active = jQuery('.slideshow .items .active');
  // use this to pull the images in the order they appear in the markup
  var next =  jQuery(active).next().length ? jQuery(active).next() : jQuery('.slideshow .items div:first');
  jQuery(next).css({opacity: 0.0})
  .addClass('active')
  .animate({opacity: 1.0}, 1000, function() {
    jQuery(active).removeClass('active');
  });

  jQuery(active).animate({opacity:0.0}, 1000, function(){
  });
}

// execute your scripts when the DOM is ready. this is mostly a good habit
jQuery('document').ready(function() {
  var active = jQuery('.slideshow .items .active');
  if ( active.length == 0 ) {
    active = jQuery('.slideshow .items div:first');
    active.addClass('active').animate({opacity: 1.0}, 1000);
  }

  jQuery(function() {
    setInterval( "slideSwitch()", 5000 );
  });
});
</script>
<div class="slideshow">
  <div class="items">
    <?php foreach($this->sectionArr as $key => $section) { ?>
    <div class="">
      <?php echo $section?>
    </div>
    <?php ?>
  </div>
</div>
บันทึกการเข้า
หน้า: [1]   ขึ้นบน
พิมพ์