I have a JQuery script which acts as a simple image rollover with a nice fade effect.
Here is a test version of the current script in action – http://fi-testing.co.uk/SO/rubix-cube.html
As you can see, there are 9 blocks, the client wishes for the rollovers to occur randomly (without a hover) to kind of create a ripple/pulsating effect.
How would this be achieved with either JQuery or php?, and would It be possible that hovering over breaks the randomisation and acts as normal?
Sorry if any of this is unclear.
Thanks for any help.
Dan
Without going too much into your code, you can create randomness by
Math.random()so if you have an array of your cube entires, indexed 0 – 8, you may use
you can use
setIntervalto get this to repeat once in every x msyou can use jQuery
triggerto invoke thehovereffect manually, but I’d say it’d be more readable to extract the code you have inhoverto a function which you call both fromhoverand fromrandomlyChangeCubes.All that being said… doing this entirely randomly probably won’t make it look rippling/pulsating…