Skip to content

Instantly share code, notes, and snippets.

@jonleecraw
Created November 28, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonleecraw/0f434146f105153e458d to your computer and use it in GitHub Desktop.
Save jonleecraw/0f434146f105153e458d to your computer and use it in GitHub Desktop.
(Nivo Slider v3.2) This is a proper slide effect that slides an image in from the left (and is visually analogous to the 'slideInRight' effect), and doesn't depend on the outer slider and wrapper having overflow:hidden.
... effects if/else if block ...
} else if(currentEffect === 'slideInFromLeft'){
createSlices(slider, settings, vars);
firstSlice = $('.nivo-slice:first', slider);
firstSlice.css({
'width': '0px',
'left' : '0px',
'right': '',
'opacity': '1'
});
firstSlice.children('img').css({
'left': 'auto',
'right': '0'
});
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){
// Reset positioning
firstSlice.css({
'left': '-0px',
'right': ''
});
slider.trigger('nivo:animFinished');
firstSlice.children('img').css({
'right': 'auto',
'left' : ''
});
});
}
... effects if/else if block continued...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment