Open seetpal-smartshore opened 7 years ago
You could use only one instance of smoothstate for differents animations.
See onbefore option, you will have the link clicked in $currentTarget
.
I am used to use a data-senario
attribute in my links, and fire differents animations from this.
Also, having one and only instance ensure that you won't start two animations in the same time.
var animateWorked = false;
$('#main_container').smoothState({
anchors: 'a',
onBefore: {
render: function($currentTarget){
animateWorked = $currentTarget.parent("#worked").length > 0;
if(animateWorked){ // do stuff for worked anim
}else{ // default animation
}
},
onStart: {
duration: 250,
render: function () {
console.log('on worked animation ? ', animateWorked);
}
},
}).data('smoothState');
I am in a big trouble, I had to implement smoothslate on static website, but know I need different script and onstart/onready durations for specific links under content area under specific container (like #main #worked a).
but for all other links I need different configuration/script.
you can see below my code.
unable to use it multiple time. Please provide some solution.