Applying jQuery to dynamically loaded elements (Premium User)
-
Question posted here:
https://github.com/dcooney/wordpress-ajax-load-more/issues/32– – – – –
Hi there
Very happy with the functionality provided by this script, but need a little help applying a function after the extra posts have loaded.
We’re using the following code to ensure images in a responsive site are always proportional:
var imagesizes = function () { var projW = $('.project-overview .image-wrap').width() * 0.85; $(".project-overview .image-wrap").css({ 'height': projW}); }; $(document).ready(imagesizes); $(window).resize(imagesizes);So far, so good. However, I’ve been struggling to get this to apply to the posts loaded by Ajax Load More. I’ve tried using an if statement and “$finished = false”, before running the image size function again, but no good.
When I resize the browser window, after loading more posts, they get dynamically resized – so we’re nearly there. I’ve tried attaching the same function to an “click” event, to activate when the load more button is pushed, but that doesn’t work either.
Any ideas appreciated!
Thanks in advance,
James
The topic ‘Applying jQuery to dynamically loaded elements (Premium User)’ is closed to new replies.