bd.slide.A09_parallaxSlider06 = function() { this.init.apply(this, arguments); }; bd.slide.A09_parallaxSlider06.prototype = { isReady: false, init: function() { bd.util.addCss(bindobj.moduleroot + '/slide/_common/ParallaxSlider/style.css'); bd.util.addCss(bindobj.moduleroot + '/slide/a09_parallaxSlider06/style.css'); head.load(bindobj.moduleroot + '/slide/_common/ParallaxSlider/jquery.ParallaxSlider.js', jQuery.fnbind(this, this.callback)); }, callback: function() { this.isReady = true; }, render: function( elem, autost, loop ) { var el = jQuery(elem); var h = el.height(); var w = el.parent().width(); var interval = parseInt(el.attr('data-interval'), 10); if(isNaN(interval) || (interval <= 0)){ interval = 6500; } var duration = parseInt(el.attr('data-duration'), 10); if(isNaN(duration) || (duration <= 0)){ duration = 1000; } var slide = jQuery('
').parent().html(); }else if(img){ imgObj = jQuery(img); } if((imgObj != null) && (imgObj.length != 0)){ var lislide = jQuery('
').appendTo(ulslide); var lithumb = jQuery('').appendTo(ulthumb); if (ancHtml) { lislide = jQuery(ancHtml).appendTo(lislide); } lislide.css('list-style-type','none'); lithumb.css('list-style-type','none'); var imgwidth = imgObj.width(); var imgheight = imgObj.height(); if (imgwidth>w-50) { imgwidth = w - 50; imgheight = imgwidth * imgObj.height()/imgObj.width(); } if (imgheight>h-90) { imgheight = h - 90; imgwidth = imgheight * imgObj.width()/imgObj.height() } //imgheight = imgwidth * imgObj.height()/imgObj.width(); jQuery('') .attr('src',imgObj.attr('src')) .width(imgwidth) .height(imgheight) .css('border','6px solid transparent') .css('margin','20px auto 0px auto') .attr('alt',imgObj.attr('alt')).appendTo(lislide); imgwidth = imgObj.width(); imgheight = imgObj.height(); jQuery('') .attr('src',imgObj.attr('src')) .width(96) .height((96)*(imgheight/imgwidth)) .css('border','4px solid #FFFFFF') .attr('alt',imgObj.attr('alt')).appendTo(lithumb); } }); slide.insertBefore(elem); el.remove(); if(bd.util.onEditBlock()){ autost = false; loop = false; } slide.parallaxSlider({ width : w, height : h, auto : (autost?interval:0), //how many seconds to periodically slide the content. //If set to 0 then autoplay is turned off. speed : duration, //speed of each slide animation easing : 'jswing', //easing effect for the slide animation easingBg : 'jswing', //easing effect for the background animation circular : loop, //circular slider thumbRotation : true //the thumbs will be randomly rotated }, function(){ wrapper.show(); slide.css({'visibility': 'visible', 'opacity': 0}).animate({ opacity: 1 }, { complete:function() { wrapper.show(); bd.util.bdRefresh(); Bindfooter.set(); } }); }); //resize var $win = jQuery(window), wFlg = jQuery('#area-contents') == $win.width(); jQuery(window).resize(function(){ var w = wFlg ? $win.width() : slide.parent().width(); slide.css('width', w + 'px'); }); } };