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? Link to comment https://forums.phpfreaks.com/topic/101239-solved-image-source-from-function/ 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? Link to comment https://forums.phpfreaks.com/topic/101239-solved-image-source-from-function/#findComment-518391 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> Link to comment https://forums.phpfreaks.com/topic/101239-solved-image-source-from-function/#findComment-519726 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.