I'm back already and google-fu has brought me nothing.
I'm trying to make a sort of image gallery and i need to reset the divs dynamically on my slider but I'm having no luck, here's the process:
- click 'left'
- left div moves forward.
- central divs ID gets called 'left' and vice versa, (using a temp ID to stop two divs having the same ID)
- the css is reset as if it never happened except for the image being different.
My problem is that they seem to be resetting completely to their original state, as if the ID change never happened, any ideas?
Here's the JSFiddle
and here's the offending code:
$('.navigationLeft').click(function() {
console.log("yay");
$( '#left' ).animate({
marginLeft: selWidth
}, 500, "linear", function() {
// Animation complete.
$( '#center' ).attr('id', 'temp');
$( '#left' ).attr('id', 'center');
$( '#center' ).attr('id', 'left');
$( '#left' ).css('width', '900px');
$( '#left' ).css('height', '400px');
$( '#left' ).css('overflow', 'hidden');
$( '#left' ).css('position', 'relative');
$( '#left' ).css('left:', '-900px');
$( '#left' ).css('overflow', 'hidden');
$( '#left' ).css('z-index', '2');
$( '#center' ).css('width', '900');
$( '#center' ).css('height', '400');
$( '#center' ).css('position', 'absolute');
$( '#center' ).css('overflow', 'hidden');
$( '#center' ).css('z-index', '1');
});
//reset positions and change images
});