DotNetNuke Skins and Resources by ThinkofDesign

Forums

Subject: Randon background image
Prev Next
You are not authorized to post a reply.

Author Messages
domukajoor User is Offline
Active Member
Active Member
Posts: 27


03/05/2007 06:30 AM  
    Hello
I am trying to have a random background image for my dnn 4.3.4 site.I don't think that we can do it with CSS ,so I tried to do it with the body tag of my html skin and it's not working at all,I cannot even place a background image with that tag using inline CSS.Any help will be appreciated.
 thanks
Vasilis User is Offline
Yellow Member
Yellow Member
Posts: 315


03/07/2007 02:16 PM  
Hey,

You can't have a body tag in your skin... it's already in the default.aspx.

You need a script to do the trick.

See the attached txt file.

Cheers

Attachment: randomBG.txt

domukajoor User is Offline
Active Member
Active Member
Posts: 27


03/13/2007 04:55 AM  
I'll try it and let you know ,thanks a lot for your help
domukajoor User is Offline
Active Member
Active Member
Posts: 27


04/09/2007 07:56 PM  

Hello

Finally I found a piece of java script code to implement a random background image and it work fine in ascx skins.My only problem is how to stop the background image from repeating,I tried many time to mess with the code but nothing work.Can please take a look of the code to see how to do it? thanks


Attachment: randomBack.txt

domukajoor User is Offline
Active Member
Active Member
Posts: 27


04/09/2007 08:11 PM  

here is the code


Attachment: randomBack.txt

Vasilis User is Offline
Yellow Member
Yellow Member
Posts: 315


04/09/2007 08:20 PM  
Add the line below at the bottom of your script:

document.body.style.backgroundRepeat = 'no-repeat';
domukajoor User is Offline
Active Member
Active Member
Posts: 27


04/10/2007 05:31 AM  

Hello

I tried to use this code before found at w3schools (http://www.w3schools.com/htmldom/prop_style_backgroundrepeat.asp)

It did not work I get a blank background no more image,and here is the code


Attachment: background.txt

Vasilis User is Offline
Yellow Member
Yellow Member
Posts: 315


04/10/2007 07:36 AM  
Replace the lines below:

document.body.background = backgr;
document.body.style.backgroundRepeat = 'no-repeat';

with this line:

document.body.style.background = 'url(\'' + backgr + '\') no-repeat';
domukajoor User is Offline
Active Member
Active Member
Posts: 27


04/10/2007 09:57 AM  
Hurraaaaaah,this time It did work,that was the solution.Thanks a lot for your help,God bless you.
You are not authorized to post a reply.
Forums > DotNetNuke > Skinning in general > Randon background image



ActiveForums 3.7