Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.49 KB | None | 0 0
  1. $("figure").on("click","img",function(){
  2.     if (typeof $("x").data('x' !== 'undefined')){
  3.         $(this).data("x",0);
  4.     }else{
  5.         $(this).data().x+=1;
  6.     }
  7.     switch($(this).data("x")){
  8.     case 0:
  9.         $(this).css("filter","sepia(100%)");
  10.         break;
  11.     case 1:
  12.         $(this).css("filter","grayscale(100%)");
  13.         break;
  14.     case 2:
  15.         $(this).css("transform","rotate(180deg)");
  16.         break;
  17.     default:
  18.         $(this).css("filter","");
  19.     }
  20. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement