I am aware this question has been asked many times but I just cannot seem to get this to work because of my almost null JS knowledge.
I am using the Zebra Dialog jquery plugin to make a modal window that I want to open when the page is loaded.
All the examples on the Zebra Dialog website only explain how to load the modal when clicking a link, but I just cannot seem to get it to load on page load.
I am using the following code right now:
<script type="text/javascript">
$(document).load(function() {
// show a dialog box when clicking on a link
$(anchor).bind('click', function(e) {
e.preventDefault();
$.Zebra_Dialog('The link was clicked!');
});
});
</script>
I am aware that I am using code for loading the modal when clicking on a link but I have tried a lot of stuff and not found a way to succesfully modify it to load on page load.
Any help would be greatly appreciated!
Perhaps jQuery is not included? You need jQuery, then the plugin js/css in your
<head>:and then the the loading code in
<body>(in script tags or loaded from a file)