using javascript's (window).load in layout.master

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
4/15/2014 2:01:53 PM
Gravatar
Total Posts 18

using javascript's (window).load in layout.master

I'm trying to add the (window).load javascript code inside the head of the layout.master file of one of the skins I'm using so the slider I'm using loads correctly.  I've put it at the very bottom of the head tags right before </head>.  Here is a portion of the code.

<portal:SkinFolderScript ID="sfs4" runat="server" ScriptFileName="js/jquery.min.js" AddToCombinedScript="false" />

<portal:SkinFolderScript ID="sfs5" runat="server" ScriptFileName="js/jquery.raccordion.js" AddToCombinedScript="false" />

<portal:SkinFolderScript ID="sfs6" runat="server" ScriptFileName="js/jquery-load-raccordion.js" AddToCombinedScript="false" />

<script type="text/javascript">

$(window).load(function () {

$('#rslider-accordion-wrapper').raccordion({

speed: 1000,

sliderWidth: 940,

sliderHeight: 300,

autoCollapse: false

});

});

</script>

</head>

When the page with the skin loads, it puts the (window).load function above the SkinFolderScript javascript files, which show up at the very bottom of the head tags.  How do you force the (window).load to be at the very bottom of the head tags?  Thanks. 

 

 

4/15/2014 2:07:47 PM
Gravatar
Total Posts 18444

Re: using javascript's (window).load in layout.master

I suggest change that first line to this:

$(document).ready(function () {

instead of:

$(window).load(function () {

also if you upgrade to the new version of mojoPortal we have a new  Custom Javascript module that you can add to a page like any feature and it has a setting for the location of the script. It can support external scripts with an url or inline blocks of script as well.

Hope that helps,

Joe

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