Help with javascript
July 25th, 2016
i want to make it that when the user clicks on a thumbnail the picture will show on the same page in the Main Central Image cell, but i don’t know what javascript command i need to use, so if someone knows, please help me.
thanks
Use Ajax library: jQuery. Read about this in google
thanks for your help but i can’t use that because this is a school project and i have specified criteria.
the help that i had from the teacher that i can use this command:
window.document.MyImage.src = �Car.gif”
It’s very easy to do with JS. There is no function to do that but you need to think about it and find out how to do that. For example, if the first thumbnail looks like that in the code:
<img src=”image.jpg”> Then make it look like this:
<img src=”image.jpg” onclick=”myFunction();”> The man image is supposed to look like that:
<img src=”bigImage.jpg” id=”myImage”>
That way you can create a very easy JS function that will change the picture:
function myFunction(){
document.getElementById[“myImage”].src=”image URL”;
}
You can make it more efficient if you want but that’s the basic idea
Good luck mate ^_^
i know this isnt exactly what in response to what you need, but i suck at javascript, but i have one of the best js/css image gallerys around on my website, from this group:
http://smoothgallery.jondesign.net/
i know you said you have to use specific criteria in your work, but the code there might help you, or even get you some extra marks (not suggesting you plagiarise, but learn and implement it yourself )
thanks you had explaind it to me very simple and now i have an idea of what to do. you too, , thanks, the site helped me too and by the way don;t worry i am not going to copy the code because one of the cratiria is against plagiarisem.
thanks for your help
You’re welcome mate, I’m glad we helped you
no probs, just thought id give back to that gallery designer by propping him here lol xD
tis quite a nice design though – and you can do some amazing stuff with a bit of css and js – no need for flash. good luck!