ulfben

ZenPhoto preloading

Jul 29th, 2011
688
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Image preloading for ZenPhoto default theme. Just add to your image.php.
  2. Ulf Benjaminsson 2011-07-30 */
  3. jQuery(document).ready(function($) {
  4.     var $nextlink = $('.imgnext > a:first-child');
  5.     var nextURL = ($nextlink) ? $nextlink.attr('href') : '';
  6.     if(nextURL == ''){return;} 
  7.     $.get(nextURL, function(data, textStatus) {
  8.         if(textStatus !== "success"){return;}  
  9.         if(console){
  10.             var n = nextURL.length;
  11.             console.log('Preloaded: '+nextURL.substring(n, n-17));
  12.         }  
  13.         $nextlink.click(function(e) {
  14.             e.preventDefault();
  15.             if(history && (typeof history.pushState == 'function')){
  16.                 history.pushState({}, "", nextURL);
  17.             }
  18.             document.open();
  19.             document.write(data);
  20.             document.close();
  21.         }) 
  22.     });
  23. });
Advertisement
Comments
  • Asithaza
    190 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • Comment was deleted
Add Comment
Please, Sign In to add comment