domukajoor


Active Member
Posts: 25
Posted: 03/05/2007 06:30 AM
Last Edit:
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


Yellow Member
Posts: 314
Posted: 03/07/2007 02:16 PM
Last Edit:
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
domukajoor


Active Member
Posts: 25
Posted: 03/13/2007 04:55 AM
Last Edit:
I'll try it and let you know ,thanks a lot for your help
domukajoor


Active Member
Posts: 25
Posted: 04/09/2007 07:56 PM
Last Edit:
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
domukajoor


Active Member
Posts: 25
Posted: 04/09/2007 08:11 PM
Last Edit:
Vasilis


Yellow Member
Posts: 314
Posted: 04/09/2007 08:20 PM
Last Edit:
Add the line below at the bottom of your script:
document.body.style.backgroundRepeat = 'no-repeat';
domukajoor


Active Member
Posts: 25
Posted: 04/10/2007 05:31 AM
Last Edit:
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
Vasilis


Yellow Member
Posts: 314
Posted: 04/10/2007 07:36 AM
Last Edit:
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


Active Member
Posts: 25
Posted: 04/10/2007 09:57 AM
Last Edit:
Hurraaaaaah,this time It did work,that was the solution.Thanks a lot for your help,God bless you.