Alcuinus

round images + shadow for chrome

Jul 11th, 2011
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function transform1(){
  2. var DOMHead = document.getElementsByTagName("head")[0];
  3. var DOMScript = document.createElement("script");
  4. DOMScript.type = "text/javascript";
  5. DOMScript.src = "http://code.jquery.com/jquery-latest.min.js";
  6. DOMHead.appendChild(DOMScript);
  7. }
  8.  
  9. function transform2(){
  10. $("head:first style:last").append(".rounded-img2 {display: inline-block;-webkit-border-radius: 10px;-moz-border-radius: 10px;border-radius: 10px;-webkit-box-shadow: inset 0 1px 5px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .9), 0 -1px 0 rgba(0, 0, 0, .6);-moz-box-shadow: inset 0 1px 5px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .9), 0 -1px 0 rgba(0, 0, 0, .6);box-shadow: inset 0 1px 5px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .9), 0 -1px 0 rgba(0, 0, 0, .6);}");
  11. }
  12.  
  13. function transform3(){
  14. $("img").toggleClass("rounded-img2");
  15. }
  16.  
  17. function transform4(){
  18. $(".rounded-img, .rounded-img2").each(function() {      $(this).wrap(function(){            return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />';     });     $(this).css("opacity","0"); });
  19. }
  20.  
  21.  
  22. transform1();
  23. transform2();
  24. transform3();
  25. transform4();
Advertisement
Add Comment
Please, Sign In to add comment