I'm working on a component where I'm trying to add a popup using Semantic UI popup, and it's working as expected. But after ajax load it's not working.
Here part of the code code -
<script type="text/javascript">
jQuery(document).ready(function($){
$('.trigger').popup({
inline : true,
hoverable : true,
position : 'bottom right',
delay: {
show: 300,
hide: 800
},
selector : {
popup : '.popup'
}
});
});
window.Oby.registerAjax(<?php echo $events; ?>, function(params) {
var o = window.Oby, el = document.getElementById('content');
if(!el) return;
o.addClass(el, "active");
o.xRequest("<?php echo $url, true, false, true); ?>", {update: el}, function(xhr){
o.removeClass(el, "active");
});
});
</script>
What can I do so it will still work after ajax content refresh/load?