mattsterp
12/3/2015 - 7:08 PM

Slider Revolution

Slider Revolution

// CHANGE THE API REFERENCE, AND THE ELEMENTS YOU WISH TO BLUR / UNBLUR
// SET START BLUR FACTOR, END BLUR FACTOR AND 

var api = revapi9,
    ElementsToBlur = api.find('.toblur.tp-caption'),
    ElementsToUnBlur = api.find('.tounblur.tp-caption'),
    UnBlurFactor = 2,
    UnBlurStart = 3,
    UnBlurEnd = 0,
	BlurStart = 0,
    BlurEnd = 5,
    BlurFactor = 2,
    blurCall = new Object();


// SOME CODE FOR BLUR AND UNBLUR ELEMENTS
// EXTEND THE REVOLUTION SLIDER FUNCTION
// CHANGE ONLY IF YOU KNOW WHAT YOU DO

blurCall.inmodule = "parallax";
blurCall.atposition = "start";
blurCall.callback = function() { 
  var proc = api.revgetparallaxproc(),
	  blur = UnBlurStart+(proc*UnBlurStart*UnBlurFactor)+UnBlurEnd,
      nblur = Math.abs(proc*BlurEnd*BlurFactor)+BlurStart;

  blur = blur<UnBlurEnd?UnBlurEnd:blur;
  nblur = nblur>BlurEnd?BlurEnd:nblur;

  ElementsToUnBlur = jQuery(ElementsToUnBlur.selector);               
  punchgs.TweenLite.set(ElementsToUnBlur,{'-webkit-filter':'blur('+(blur)+'px)', 'filter':'blur('+(blur)+'px)'});		
  punchgs.TweenLite.set(ElementsToBlur,{'-webkit-filter':'blur('+(nblur)+'px)', 'filter':'blur('+(nblur)+'px)'});		
}

api.bind("revolution.slide.layeraction",function (e) {
	blurCall.callback();
});

api.bind("revolution.slide.onloaded",function (e) {
	revapi9.revaddcallback(blurCall);
});