Trying to set up a button that rotates a gear and changes an image at the same time. The gear works, part of my script for changing the picture works, but the picture doesn't change. Here's the site. If you keep your console open when you click the button you'll see what I mean by "part of my script" is working.
Here's the JS,
var imgs = ["datalife.jpg", "sevendoors.jpg", "plush.jpg"]; var imgx = 0; $("#swapper").src = "images/" + imgs[imgx];
Also, everything should be included within the $(document).ready() callback function. Even your vars at the top. I'm not aware of a .rotate() jQuery function, which plugin are you using?
Great! Hmmm, I would use modernizr and detect for transform ( eg: transform: rotate(90deg) ) and use the jQuery plugin as a fallback. I'm sure that any browser that doesn't support the transform property won't support transitions.
Here's the JS,
That isn't going to change the src attribute, however, this will:
Also, everything should be included within the $(document).ready() callback function. Even your vars at the top. I'm not aware of a .rotate() jQuery function, which plugin are you using?