modal window not trigger in pages appended when using masonry #24

Closed
cancerian73 opened this Issue May 16, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@cancerian73

I don't know what am I doing wrong. I have a site with masonry used and appending pages. The modal window works fine on the first page and individually when i call the 2nd page direct but when it appends using infinite scroll it doesnt work.

this is the first page http://www.spheretekk.com/ych/media-videos.html

this is the second page http://www.spheretekk.com/ych/2.html

Title with 'this modal window doesnt work'..when click on image it doesn't open a modal

Can you please let me know what am I doing wrong

Thank you

@desandro

This comment has been minimized.

Show comment Hide comment
@desandro

desandro May 16, 2013

Owner

Sounds like you need to bind the click event to the newly appended elements. A better way to do this is with event delegation.

// instead of
$(".open_fancybox").click(function(){...});
// try
$('#container').on( 'click', '.open_fancybox', function() {...})

Sorry, this is a separate issue, not related to Vanilla Masonry.

Owner

desandro commented May 16, 2013

Sounds like you need to bind the click event to the newly appended elements. A better way to do this is with event delegation.

// instead of
$(".open_fancybox").click(function(){...});
// try
$('#container').on( 'click', '.open_fancybox', function() {...})

Sorry, this is a separate issue, not related to Vanilla Masonry.

@desandro desandro closed this May 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment