View Full Version : Using Javascript with Adobe Muse

04-19-2013, 09:49 AM

For the last 4 days I've been scanning the entire internet trying to solve my problem but to no avail.
Either the answers I found wouldn't work or, well, I didn't quite understand them. (Hence the username ;) )

I am currently working on a project where my client insists I use Adobe Muse. This is not really an issue as I have been able to add code though I'm having problem with the code working properly.

I am trying to get a random background load each time the website reloads. So far, this has worked, however, it keeps tiling the image.
I have tried asking Adobe staff and forums but not really getting anywhere since most people have ignored my question :( So I'm sort of hoping to find some help here as I am convinced it is an easy fix..I just don't know how.

This is what I currently have added to my html code at the end of the document (i'm not sure if it is meant to be somewhere else..it seems to WORK there though)<script type="text/javascript">

// # of images
var imgCount = 3;
// image directory
var dir = 'http://skywide.co.uk/test3/images/';
// random the images
var randomCount = Math.round(Math.random() * (imgCount - 1)) + 1;
// array of images & file name
var images = new Array
images[1] = "background_test2.jpg",
images[2] = "background_test.jpg",
images[3] = "temp_background-03-08.png",
$('html').css('background-image','url("' + dir + images[randomCount] + '")');

Any help is really appreciated :) Though please bare in mind I may need to know where to put any extra code (like, be told exactly where to paste it)

Thank you! :)

05-21-2013, 03:52 PM
Hey there,

I have a similar problem, did you have any luck in resolving that?

05-21-2013, 10:13 PM
Hey there,

I have a similar problem, did you have any luck in resolving that?


Did you alter the index.CSS?