Hi guys, Not made a topic in here for a while but i'll try and keep this short and sweet. How is this image effect done on the following web page: http://www.casinochoice.co.uk/reviews/intercasino When the page first loads the ratings bars grow into position - and the bar is only a background image - how is this achieved? The bars i am referring to are the ratings o the left such as Graphics, Playability etc. Any advice greatly appreciated Cheers
Do a View Source and the relevant part is near the bottom: document.getElementById('graphicsrating').style.width = "0%"; document.getElementById('playabilityrating').style.width = "0%"; document.getElementById('gamevarietyrating').style.width = "0%"; document.getElementById('promotionsrating').style.width = "0%"; document.getElementById('overallrating').style.width = "0%"; document.getElementById('paymentoptionsrating').style.width = "0%"; window.onload = function() { ratingBarTransition('graphicsrating',90); setTimeout("ratingBarTransition('playabilityrating',90);",50); setTimeout("ratingBarTransition('gamevarietyrating',100);",100); setTimeout("ratingBarTransition('promotionsrating',100);",150); setTimeout("ratingBarTransition('paymentoptionsrating',90);",200); setTimeout("ratingBarTransition('overallrating',94);",800); } Code (markup): The function in question is ratingBarTransition() which is located in one of the included script files (not sure which one because I didn't load them). Check each of those for the appropriate code.
A guess would be the width is resized. Here's a function from the JS: function ratingBarTransition(id,num) { bar = document.getElementById(id); baranim = new Tween(bar.style,'width',Tween.strongEaseInOut,0,num,1,'%'); baranim.start(); } Pulled from http://www.casinochoice.co.uk/js/general.js And there is a Tween.js as well. Odds are mootools could do this. Well with what vpguy posted, you almost have a solution
thanks for the quick responses, shame my javascript isn't up to scratch and i only know the basics or i could create something similar i'll see wha mootolls has to offer