Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript
Previous
 
Next
New Post
11/3/2007 5:07 AM
 

hi,

I followed your suggestion (put the script entirely in a separate js) . The problem is that the script doesn't work: it seems not to find the default page (have a look online www.davico.ch). The js file is meant to load a different banner-pic each day.

I think the problem lies in the last line of code (document.get....). This script works fine on a normal static html page (already tested) but within dnn it doesn't. Any idea how to solve this? Thanks

window.onload = function () {
 var today = new Date();
 var first = new Date(today.getFullYear(), 0, 1);
 var theDay = Math.round(((today - first) / 1000 / 60 / 60 / 24) + .5, 0);
 var picNr = 10;
 var picUse;
 picUse = theDay%picNr;
document.getElementById('TopPane').style.background='url(/Portals/1/img/'+picUse+'.jpg)';
}

 
New Post
11/3/2007 10:15 AM
 

also with the following code I get the same error. I think is the last line of code "document.getElementById('TopPane'...". Any idea? Thanks

if (window.addEventListener){
            window.addEventListener("load", topbanner, false);
        }
        else if (window.attachEvent){
            window.attachEvent ("onload", topbanner)
        }

function topbanner () {
 var today = new Date();
 var first = new Date(today.getFullYear(), 0, 1);
 var theDay = Math.round(((today - first) / 1000 / 60 / 60 / 24) + .5, 0);

 var picNr = 10;
 var picUse;
 picUse = theDay%picNr;

 document.getElementById('TopPane').style.background='url(/Portals/1/img/'+picUse+'.jpg)';
 
 }

 
New Post
11/3/2007 11:34 AM
 

Will

The only thing I did was list the current possibilites, for both ascx and HTML skinning

If you prefer to use HTML skinning, just put the JS at the bottom of the HTML page.

 

 
New Post
11/3/2007 11:38 AM
 

The toppane gets an id "dnn_TopPane" when the page is rendered.

I guess that's the reason your JS doesn't work

 
New Post
11/3/2007 11:58 AM
 

Timo, that was it. thanks

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out