10-08-2010
9,
0
Join Date: Sep 2010
Last Activity: 10 October 2010, 4:04 AM EDT
Posts: 9
Thanks Given: 3
Thanked 0 Times in 0 Posts
Need help with Javascript
Hi guys,
Ok first, let me explain what I want to do. I'm making a theme for the iphone, and I found a nice wallpaper slideshow script. Here is how it knows which wallpapers to use:
[code]
<script type="text/javascript">
// SLIDE ROTATION FREQUENCY (in minutes)
var slideRotation = 0.4;
// SLIDES - they can point to any location on your phone, or a url on the internet
// image - The location of the image to display, such as a location on your phone
// or a url on the internet.
// zoom - The starting level of zoom.
// origin - Use this property to change the starting origin of the zoom. The origin
// is expressed as a percentage of the size of the element (x and y). For
// example, the default value 50% 50% causes the zoom to start at the center
// of the slide. Changing the origin to 100% 0% causes transformation to
// occur around the top-right corner of the slide, etc.
var slide = [
{ image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper13.png", zoom: "100%", origin: "53% 20%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper1.png", origin: "53% 28%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper2.png", origin: "53% 20%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper3.png", origin: "53% 20%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper4.png", origin: "53% 20%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper5.png", origin: "53% 20%" },
{ image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper6.png", origin: "0% 40%" },
{ image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper7.png", origin: "85% 5%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper8.png", origin: "85% 5%" }, { image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper9.png", origin: "85% 5%" },
{ image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper11.png", origin: "53% 20%" },
{ image: "/Library/Themes/iMatte UI.theme/slides/Wallpaper12.png", origin: "84% 23%" },
];
</script>
[/code]
Would there be a way of telling it to look in a specific directory and use all, let say, Wallpaper*.png and build the variable array with it? And maybe have random origin values? So they are all coming from a different angle?
Thanks, I would really appreciate if that could be made possible!
Last edited by vbe; 10-08-2010 at 01:52 PM..
Reason: code tags maybe not a good idea...