View Single Post
Old 01-03-2013, 01:04 AM   PM User | #1
Cryon
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Cryon is an unknown quantity at this point
Editing Javascript Image Gallery

Hi

I've been using this gallery/slideshow for a while:
Dynamic Drive DHTML Scripts- Simple Controls Gallery

This uses Jquery and an simplegallery.js that contains the code. I've also put the variables (image locations) in an externally referenced file called variables.js

Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript" src="simplegallery.js">
<script type="text/javascript" src="variables-spring.js">
Code:
var mygallery=new simpleGallery({
	wrapperid: "simplegallery1", //ID of main gallery container,
	dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
	imagearray: [
		["http://i26.tinypic.com/11l7ls0.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new", "There's nothing like a nice swim in the Summer."],
		["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "", ""],
		["http://i30.tinypic.com/531q3n.jpg", "", "", "Eat your fruits, it's good for you!"],
		["http://i31.tinypic.com/119w28m.jpg", "", "", ""]
	]
I have four variable files 'variables-spring.js', 'variables-summer.js', 'variables-fall.js', 'variables-winter.js'. Currently I change the <script type="text/javascript" src="variables-spring.js"> manually depending on the time of year.

What I would like to have is this done automatically. I guess this is more involved than a small bit of editing to the current code. Can anyone help?
Cryon is offline   Reply With Quote