Body onload to show popup

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/29/2010 6:53:56 AM
Gravatar
Total Posts 32

Body onload to show popup

Hi There,

We are using mojoportal for many sites but now we run into a problem.

a client wants a popup advert during the visitors first page load so we have a function in javascript for the onload event that will create a popup window with the ad.

However we can't figure out WITHOUT changing the core and aspx pages how to insert a script in the header of a page and an onload event.

maybe it is a feature request to add to Page a section to write additional code

 

11/29/2010 8:14:10 AM
Gravatar
Total Posts 18439

Re: Body onload to show popup

It is very easy to do, you can add script using source view of the editor in an Html Content Instance (or in layout.master) like this:

<script type="text/javascript">
$(document).ready(function() { alert('hello there'); });
</script>

you would just put your own code to show the popup where I have used alert function.

this uses jquery to call the function after the page has loaded.

Hope it helps,

Joe

11/29/2010 8:23:09 AM
Gravatar
Total Posts 18439

Re: Body onload to show popup

We even have popup code you can use, because Greybox is built in to mojoPortal, so you can do something like this:

<script type="text/javascript">
$(document).ready(function()
{
GB_showCenter('Google', 'http://www.google.com')
});
</script> 

for more examples see greybox documentation.

You must sign in to post in the forums. This thread is closed to new posts.