Search the Community
Showing results for tags 'random images'.
-
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: