The Easter Sale is on! Join now or renew your subscription with a 25% OFF! Read More

Support Forum

vincent
vincent
Offline
http://wptv.nycweb.io/uikit.php

This page shows how it is supposed to work. When the link is clicked, console output "Modal is visible". The code is as follows:
<html>
<head>
<title></title>
<link rel="stylesheet" href="/uikit/css/uikit.min.css" />
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="/uikit/js/uikit.min.js"></script>
<script>
jQuery(document).ready(function($){
$('#my-id').on({
'show.uk.modal': function(){
console.log("Modal is visible.");
}
});
})
</script>
</head>
<body>
<a href="#my-id" data-uk-modal>click</a>


<!-- This is the modal -->
<div id="my-id" class="uk-modal">
<div class="uk-modal-dialog">
<a class="uk-modal-close uk-close"></a>
something
</div>
</div>
</body>
</html>


But when I try to implement this into my website that is using IT template(headline), it won't work: If I put the event binder in "jQuery(document).ready", the function seems not attached to event 'show.uk.modal', meaning there won't be any output in console when I click open a modal; however, if I copy the event binder and run it in console after the page is loaded, it will work.
See the test link here: http://worldpeaceever.tv/index.php/uikittest
and screenshot in attachement.

I'd thought this is a question with uikit, but since the above link works, I think it is not a problem with them, but probably have to do the way uikit is loaded in IT template. Could you please take a look? Thanks.
Attachments:
Responses (3)
Sorry, but you are not allowed to view the replies here.
Your Reply

Become an insider | Subscribe to our Newsletter
Subscribe to our mailing list and stay up-to-date with all our awesome releases, latest updates and amazing discount offers!