Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // replace an image when thumbnail clicked
  2. function updateMainImage() {
  3. $('.thumbnail').on("click", "img", function() {
  4. $('.mainpic').attr('src', $(this).attr('src'));
  5. });
  6. }
  7.  
  8. $(document).ready(updateMainImage());
  9.  
  10. // also needed to add class to image in html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement