Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // replace an image when thumbnail clicked
- function updateMainImage() {
- $('.thumbnail').on("click", "img", function() {
- $('.mainpic').attr('src', $(this).attr('src'));
- });
- }
- $(document).ready(updateMainImage());
- // also needed to add class to image in html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement