WordPress.org

Ready to get started?Download WordPress

Forums

WP jQuery Lightbox
Does not load correctly - any image clicked first loads as .jpg (2 posts)

  1. wp-super-user
    Member
    Posted 5 months ago #

    Have tried multiple ways of fixing a problem with this plugin that does not load correctly. The length of time allowed after the initial page load makes no difference - whether the page has loaded for 1 second or 15 seconds: the first image that is clicked on, not necessarily the first in the gallery, loads as a normal /imagename.jpg page. Then when the visitor clicks "back" then reloads the same image, the lightbox plugin "kicks-in" and works. It is as though an image needs to be clicked on to activate the plugin on the page. Other than that, everything works fine and looks beautiful.

    Tried the following:

    Smush.it plugin for all images, thinking they were too large;

    Plugin Organizer plugin and ordered jQuery Lightbox plugin to load first;

    Used W3TC to clear all page caches.

    None of these seem to do the job.

    Any ideas?

    http://wordpress.org/plugins/wp-jquery-lightbox/

  2. wp-super-user
    Member
    Posted 5 months ago #

    For what it is worth, I have put the following code in the Custom Java Script on the Main page of the Options part of the WP Dashboard, still no luck:

    jQuery(document).ready(function doLightBox(){
    	var haveConf = (typeof JQLBSettings == 'object');
    	var ss, rs, ms = 0;
    	if(haveConf && JQLBSettings.slideshowSpeed) {
    		 ss = parseInt(JQLBSettings.slideshowSpeed);
    	}
    	if(haveConf && JQLBSettings.resizeSpeed) {
    		rs = parseInt(JQLBSettings.resizeSpeed);
    	}
    	if(haveConf && JQLBSettings.marginSize){
    		ms = parseInt(JQLBSettings.marginSize);
    	}
    	var default_strings = {
    		help: ' Browse images with your keyboard: Arrows or P(revious)/N(ext) and X/C/ESC for close.',
    		prevLinkTitle: 'previous image',
    		nextLinkTitle: 'next image',
    		closeTitle: 'close image gallery',
    		image: 'Image ',
    		of: ' of ',
    		download: 'Download',
    		pause: '(pause slideshow)',
    		play: '(play slideshow)'
    	};
    	jQuery('a[rel^="lightbox"]').lightbox({
    		adminBarHeight: jQuery('#wpadminbar').height() || 0,
    		linkTarget: (haveConf && JQLBSettings.linkTarget.length) ? JQLBSettings.linkTarget : '_self',
    		showInfo: (haveConf && JQLBSettings.showInfo == '0') ? false : true,
    		displayHelp: (haveConf && JQLBSettings.help.length) ? true : false,
    		marginSize: (haveConf && ms) ? ms : 0,
    		fitToScreen: (haveConf && JQLBSettings.fitToScreen == '1') ? true : false,
    		resizeSpeed: (haveConf && rs >= 0) ? rs : 400,
    		slidehowSpeed: (haveConf && ss >= 0) ? ss : 4000,
    		displayDownloadLink: (haveConf && JQLBSettings.displayDownloadLink == '0') ? false : true,
    		navbarOnTop: (haveConf && JQLBSettings.navbarOnTop == '0') ? false : true,
    		strings: (haveConf && typeof JQLBSettings.help == 'string') ? JQLBSettings : default_strings
    	});
    })

Reply

You must log in to post.

About this Plugin

About this Topic