javascript+HTML5自定义元素播放焦点图动画(3)

$(document).ready(function(){ var $backgrounds = $(".header-content").find(".parallax-bg"), LAYER_OFFSET = 30, PRLX_SPEED = 1500, $slider; $slider = $("#slider").tlrkSlider({ autoStart: true, animationStart: function(ev, slider, step){ var max_steps = this.framesCount; $backgrounds.each(function(idx, el){ var pos = (step * (100 / max_steps)) + (LAYER_OFFSET * idx); $(this).animate({"backgroundPosition": pos + "% 0"}, PRLX_SPEED); }); }, elements: { "img": {delay: 10}, "h2": {delay: 500}, ".copy": {delay: 800}, ".button": {delay: 1000} } }); $(".header-content") .hover( function(){$(this).find(".slider-prev, .slider-next").show();}, function(){$(this).find(".slider-prev, .slider-next").hide();} ) .find(".slider-prev").click(function(){$slider.tlrkSlider("go", "prev"); return false; }).end() .find(".slider-next").click(function(){$slider.tlrkSlider("go", "next"); return false; }); });

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgypxg.html