Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var med = {
- imgLoadTime : 2000,
- easingEffect : 'easeOutQuart',
- scrollEase : 'easeInOutQuad',
- effectDuration : 1000,
- currentPage : '',
- runAnimations : function(){
- if(this.currentPage == '#slide5'){
- this.initAssets();
- }
- },
- initAssets : function(){
- $('#asset-1').animate(
- {left : '50%'},
- {
- duration: this.effectDuration,
- easing: this.easingEffect,
- complete: this.assetTwo
- });
- },
- assetTwo : function(){
- console.log('two');
- debugger;
- $('#asset-2').animate(
- {left : '50%'},
- {
- duration: this.effectDuration,
- easing: this.easingEffect,
- complete: this.assetThree
- });
- },
- assetThree : function(){
- console.log('three');
- $('#asset-3').animate(
- {left : '50%'},
- {
- duration: this.effectDuration,
- easing: this.easingEffect,
- complete: console.log('weszlo')
- });
- }
- };
- complete: this.assetTwo
- initAssets : function(){
- var self = this;
- $('#asset-1').animate(
- {left : '50%'},
- {
- duration: this.effectDuration,
- easing: this.easingEffect,
- complete: function() {self.assetTwo()}
- });
- },
- assetTwo : function(){
- //debugger;
- $('#asset-2').animate(
- {left : '50%'},
- {
- duration: med.effectDuration,
- easing: med.easingEffect,
- complete: med.assetThree
- });
- },
- var med = {
- imgLoadTime: 2000,
- currentPage: '',
- css : {left: '50%'},
- animOptions: {
- duration: 1000,
- easing: 'easeOutQuart'
- };
- runAnimations: function() {
- if(med.currentPage == '#slide5') {
- $.Deferred(function(dfr) {
- dfr.pipe(function() {
- return $('#asset-1').animate( med.css, med.animOptions );
- }).pipe(function() {
- return $('#asset-2').animate( med.css, med.animOptions );
- }).pipe(function() {
- return $('#asset-3').animate( med.css, med.animOptions );
- })
- }).resolve();
- }
- }
- };
- function runAnimations() {
- var imgLoadTime = 2000,
- currentPage = '',
- css = {left: '50%'},
- animOptions = {
- duration: 1000,
- easing: 'easeOutQuart'
- };
- if(currentPage == '#slide5') {
- $.Deferred(function(dfr) {
- dfr.pipe(function() {
- return $('#asset-1').animate( css, animOptions );
- }).pipe(function() {
- return $('#asset-2').animate( css, animOptions );
- }).pipe(function() {
- return $('#asset-3').animate( css, animOptions );
- })
- }).resolve();
- }
- }
Add Comment
Please, Sign In to add comment