Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Image preloading for ZenPhoto default theme. Just add to your image.php.
- Ulf Benjaminsson 2011-07-30 */
- jQuery(document).ready(function($) {
- var $nextlink = $('.imgnext > a:first-child');
- var nextURL = ($nextlink) ? $nextlink.attr('href') : '';
- if(nextURL == ''){return;}
- $.get(nextURL, function(data, textStatus) {
- if(textStatus !== "success"){return;}
- if(console){
- var n = nextURL.length;
- console.log('Preloaded: '+nextURL.substring(n, n-17));
- }
- $nextlink.click(function(e) {
- e.preventDefault();
- if(history && (typeof history.pushState == 'function')){
- history.pushState({}, "", nextURL);
- }
- document.open();
- document.write(data);
- document.close();
- })
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement