Search the Community
Showing results for tags 'background cover'.
-
Hello, I've just began with processwire. I've managed to link all the connections I needed to do with <?php echo $config->urls->templates?>. Ok, everything seems to work from my original html/css. But! I have a javascript file which loads random pictures from an array and after it selects it from the given url. This is the javascript code: $(window).load(function() { var randomImages = ['img1','img2','img3']; var rndNum = Math.floor(Math.random() * randomImages.length); var url = 'url(_img/bg_array/' + randomImages[rndNum] + '.jpg)' $('#home').css({ 'background': url + 'no-repeat center center fixed', '-webkit-background-size': 'cover', '-moz-background-size': 'cover', '-o-background-size': 'cover', 'background-size': 'cover' }); }); I also uploaded the file it if you want to work with it directly. Its quite useful this code. In my html/css it works perfectly, also tried with MAMP PRO and it works fine. Once I apply all my work into processwire every background image is loaded except the #home. Therefore my javascript file onload.js is not performing ok with processwire. Do I need to add something??? please help. Thx Dani onload.js.zip
- 12 replies
-
- javascript
- onload
-
(and 3 more)
Tagged with:
-
Hello, Just beggining with PW. I've managed to create the url of the html document correctly with this code: <?php echo $config->urls->templates?> . Ok, easy. I have assigned to different divs a background image with CSS. This is an example of one of them: #music{ background: url(../_img/bg_pages/HBP-Music.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } My file structure is as the picture I uploaded shows for any hints. With this actual file structure it works perfectly when its not in PW. Do I need to paste a code to redirect it? I have several images loaded by CSS and none of them work. I also have checked the template example and I see nothing special within the url. Could you help me out?
- 2 replies
-
- css
- background
- (and 6 more)