Guest User

WFFSFW

a guest
Oct 26th, 2013
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       WFFSFW
  3. // @namespace  pewpewpew
  4. // @version    0.1
  5. // @description  enter something useful NO U
  6. // @match      http://wickedfire.com/*
  7. // @match      http://*.wickedfire.com/*
  8. // @copyright  2012+, You
  9. // ==/UserScript==
  10.  
  11.  
  12. var imgArr = document.getElementsByTagName("img");
  13. var imgPlaceholder = "http://colourlovers.com.s3.amazonaws.com/images/patterns/612/612625.png?1253841027";
  14.  
  15. for( var imgItr = 0; imgItr < imgArr.length; imgItr++ ){
  16.     toPlaceholder( imgArr[imgItr] );
  17.  
  18.     imgArr[imgItr].onmouseover = function(){
  19.         toRealImage( this );
  20.     }  
  21.     imgArr[imgItr].onmouseout = function(){
  22.         toPlaceholder( this );
  23.     }
  24. }
  25.  
  26. function swappityswap( imageObject ){
  27.     var tmpHolder = imageObject.getAttribute( "src" );
  28.     imageObject.setAttribute( "src", imageObject.getAttribute( "srcx" ) );
  29.     imageObject.setAttribute( "srcx", tmpHolder );
  30. }
  31.  
  32. function toPlaceholder( imageObject ){
  33.     if( imageObject.width == 0 || imageObject.height == 0 || imageObject.getAttribute( "src" ) == null ){
  34.         setTimeout( toPlaceholder, 100, imageObject );
  35.         return;
  36.     }
  37.     imageObject.setAttribute( "width", imageObject.width + "px" );
  38.     imageObject.setAttribute( "height", imageObject.height + "px" );
  39.     imageObject.setAttribute( "style", "background-image: url(" + imgPlaceholder + "); background-repeat: repeat;" );
  40.  imageObject.setAttribute( "realsrcpleasestandup", imageObject.getAttribute( "src" ) );
  41.     imageObject.removeAttribute( "src" );
  42.     imageObject.removeAttribute( "title" );
  43.     imageObject.removeAttribute( "alt" );
  44. }
  45.  
  46. function toRealImage( imageObject ){
  47.  imageObject.setAttribute( "src", imageObject.getAttribute( "realsrcpleasestandup" ) );
  48.     imageObject.removeAttribute( "style" );
  49. }
Advertisement
Add Comment
Please, Sign In to add comment