I'm another Flash guy getting into Javascript with GSAP. I'm making a photo gallery and can't seem to get GSAP tweens to read function parameters when I send them via PHP to my Javascript function. For example, I make a PHP call like this:
$imageFile = glob("images/*.*");
echo '<img src="'.$imageFile[1].'" id="thumbPic"
onmouseover="imageOver(this)"
onmouseout="imageOut(this)"
/>';
to my Javascript functions like this:
function imageOver(object) {
TweenMax.to(object, .5, {width:100, ease:Cubic.easeOut});
}
function imageOut(object) {
TweenMax.to(object, .5, {width:85, ease:Cubic.easeOut});
}
When I manually call these functions with the "this" parameter from HTML, it works great. But when I write the same HTML via PHP, it doesn't tween. When I trace the "object" parameter I get the same "HTMLImageElement". I've tried calling the image ID directly by doing this:
TweenMax.to("#thumbPic", .5, {width:85, ease:Cubic.easeOut});
But that doesn't work either. Any thoughts?