adam291086 Posted April 15, 2008 Share Posted April 15, 2008 i am not sure how to explain this but i will try with the coding i have this function function grayOut(vis, Id, largeimage, options) i am trying to set an image source to equal largeimage var Display=document.getElementById('viewPic'); Display.src =largeimage; the object largeimage is set like this onclick="grayOut(true,<?php echo $id ?>,<?php echo $image ?>,{'opacity':'60'})"> nothing happens at the moment when i click on the image. Any ideas? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted April 16, 2008 Share Posted April 16, 2008 Ok let me try to figure this one out. Youre trying to change the src attribute of an image right? so for example <img scr="an_image.jpg" /> here you want to change an_image.jpg is that it? Quote Link to comment Share on other sites More sharing options...
adam291086 Posted April 17, 2008 Author Share Posted April 17, 2008 i am trying to set an image source to == a function perameter value function test (image) { document.getElementById(1).src=image; } <html> <img src = "pic1.jpg" id="1" onclick="test(pic2.jpg)"> </html> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.