Closed marcopolo8 closed 8 years ago
Maybe don't use opened event? If you use ajax to load modal content, I think that waiting for opened event is little too late. I do that this way:
find('.modal-open').click(function(event) {
event.preventDefault();
var link = $(this);
var url = link.data('ajax-route') || link.attr('href');
$.ajax({
url: url,
data: null,
dataType: 'html',
success: function(response) {
$('.remodal').append(response);
var modal = $('[data-remodal-id="modal"]').remodal({
hashTracking: false
});
modal.open();
}
});
});
I hope that this will help you :)
@zacol I really appreciate it man! This is a HUGE help! Again, thanks for offering help.
Quick question, I'm using the "opened" event handler to perform some jQuery updates as well as make an Ajax call. I wanted to know how can I access the value of the "href" attribute that calls Remodal? For example:
Link:
Event:
Thanks for any tips.