Advertisement
rg443

grid_preview - wallpowper

May 11th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // http://www.wallpowper.com/wallpaper/2013/05/01/?C=M;O=A
  2. var b=document.body.innerHTML.match(/[\w+-]+\.jpg(?=">)/gim)||[],j=0;
  3. localStorage["w"+location.href.match(/\d+/g).slice(-3).join("")]=b.join(" ");
  4.  
  5. function grid_preview(start){
  6. if (!start) start=0;
  7. for (var a=[],i=start;i<start+450;i++) {a.push('<img src="http://127.0.0.'+ (i%30+1) + '/wp1/' + location.hostname+ location.pathname.replace("wallpaper","medium") +'/'+b[i]+'?resize=320,200" style="width:320px;height:200px" onerror="rem3(this)" />'); if (i>=b.length) break;}
  8. window.stop();
  9. document.body.innerHTML="<div style=\"width:1300px;\">" +a.join("")+"</div>";
  10. document.body.insertAdjacentHTML("beforeEnd",'<br><a href="#" onclick="grid_preview(j+=450);setTimeout(window.scroll,200,0,0);return false;" style="font:menu;font-size:14pt;color:black;text-decoration:none;">more</a>');
  11. document.body.insertAdjacentHTML("beforeEnd",'<a href="#" onclick="grid_preview(j-=450);setTimeout(window.scroll,200,0,0);return false;" style="font:menu;font-size:9pt;color:black;text-decoration:none;margin-left:10px;" title="scroll back"> scroll back </a>');
  12. document.title="imgur1 - " +start;
  13. window.scroll(0,0);
  14. }
  15. function rem1(el){setTimeout(function(){el.parentElement.removeChild(el)},100);}
  16. function rem2(el){el.style.display="none";}
  17. function rem3(el){el.style.visibility="hidden";}
  18.  
  19. grid_preview(j);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement