Created
November 28, 2014 16:12
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... 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