Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Activating inside AJAX included page
(1 viewing) (1) Guest
"ARI Fancy Lightbox" WordPress plugin
Go to bottomPage: 1
TOPIC: Activating inside AJAX included page
#60281
Activating inside AJAX included page 6 Years, 11 Months ago Karma: 0
Hello,
I'm using pro version of your great lightbox plugin for WordPress, and am having a problem I hope you'll be able to help me with.

On one of the user profile pages, I'm calling a gallery (custom attachment display code) page though AJAX (user needs to stay on same profile tab, so this is a workaround). I've built the gallery code to include the necessary ARI classes, but whe I click one of the AJAX loaded thumbnails, nothing happens.

I've read about it & had found that I have to reinitialize the lightbox after the new AJAX content is loaded, but am not a programmer and not sure what's the code/function to do so, nor where to put the code. Any suggestions? Thanks!

Current code (with loader image):

Code:

// Catch the click on your a tag
 $(document).ready(function(){
        var trigger = $('#albumsdiv a'),
            container = $('#albumsdiv');
        trigger.on('click', function(e){
          var $this = $(this), 
            target = $(this).attr('href');  
    // Load the content of the page referenced in the a-tags href
          container.load(target);
    // Prevent browsers default behavior to follow the link when clicked
    return false;
});
      }); 
$(document).ajaxStart(function(){
    $("#load").css("display", "block");
});
$(document).ajaxComplete(function(){
    $("#load").css("display", "none");
});

The administrator has disabled public write access.
 
#60284
Re:Activating inside AJAX included page 6 Years, 11 Months ago Karma: 747
Hello,

Update the plugin to v. 1.5.10 and use the following code to attach the lightbox to new elements:

Code:


jQuery(document).trigger('fancybox-refresh');



or the following is also possible:

Code:


if (window['ARI_FANCYBOX_INSTANCE']) window.ARI_FANCYBOX_INSTANCE.convertElements();



If have any questions or need more assistance, let us know.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#60303
Re:Activating inside AJAX included page 6 Years, 11 Months ago Karma: 0
Thank you so much for quick response and making your plugin even better!
Sorry to bother you again, but where would I put this code? I'm very far from a javascript programmer, and an example would be most helpful. Thanks again!
The administrator has disabled public write access.
 
#60304
Re:Activating inside AJAX included page 6 Years, 11 Months ago Karma: 747
Use the following code:

Code:


container.load(target, function() { $(document).trigger('fancybox-refresh'); });



instead of:

Code:


container.load(target);



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1