Run function on page load once only

In that page the popup window is shown when clicking the link. I have trying to alter the script so the modal popup comes up when the page is displayed and just once but anything I tried didn’t work.

How then to trigger this function once on page load and once only ?


… is one way of doing it.



The script shown below gives me: Uncaught ReferenceError: avgrund is not defined

<script src="../jquery.avgrund.js"></script>
		height: 200,
		holderClass: 'custom',
		showClose: true,
		showCloseText: 'close',
		onBlurContainer: '.container',
		template: '<p>So implement your design and place content here! If you want to close modal, please hit "Esc", click somewhere on the screen or use special button.</p>' +
		'<div>' +
		'<a href="" target="_blank" class="github">Avgrund on Github</a>' +
		'<a href="" target="_blank" class="twitter">Twitter</a>' +
		'<a href="" target="_blank" class="dribble">Dribbble</a>' +

I am not at all familiar with avgrund. The first thing that I would check is to make sure that the relative path to the src in your first <script> tag is correct.

Also, check to make sure that you have a closing } for your avgrund. Or remove the { before your avgrund.



The documentation says this.

If you want to show avgrund on page load set this option value to false, example:

    openOnEvent: false

Which I suppose should be in document ready.

$(function() {
         openOnEvent: false

That will open automatically on page load.

I just copied the files and it worked straight away for me (having never seen it before).

1 Like

Which makes things worse is that I reviewed the options several times. :unamused:
Thanks Paul !

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.