jSlide Inline JavaScript image slideshow

jSlide Inline is a lightweight but versatile image slideshow that displays slideshows on your web page. jSlide Inline is easy to install and completely customizable.

You may also be interested in the original version.

Demo

Download

Upload this Javascript file to your server:

jSlide Inline download

Click the above file to copy the text directly, or right-click and choose "Save Link As..."

Install

Step 1 - Include jQuery

jSlide Inline requires jQuery to run. If you don't already have jQuery on your page, include the following line in the <head> tag:

<script type="application/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

jSlide Inline has been tested to work with jQuery 1.9.0.

Step 2 - Include jSlide Inline

Include the following line in the <head> tag of your page, after jQuery has been included:

<script type="application/javascript" src="/jslide.js"></script>

Modify the src attribute so that it points to the file you downloaded above.

Step 3 - Setup slideshow

Create a <div> with a unique id for the slideshow:

<div id="slider_id"></div>

After the div, open a <script> tag and call jslide('slider_id').setup(); where 'slider_id' is the unique id of the div above.

Optionally, inside the parenthesis of setup(), insert a JavaScript object containing your settings preferences. See example below:

<script type="text/javascript">
jslide('slider_1').setup({

width: 800,
height: 200,
scale: 'fit',
speed: 1200,
autoplay: true,
images: [
['images/01.jpg','caption 1'],
['images/02.jpg','the second caption'],
'images/03.jpg',
['images/04.jpg','last caption']
],

controls:{
rounded: 10,
height: 200,
opacity:0.8
},

captions: {
background:'blue',
position: 'top',
width: '500',
rounded: 10,
align: 'right'
}

});
</script>

Settings

The following settings should be inserted into a JavaScript object and used when calling setup() (see Install above). Any combination of settings can be used—the default for a particular setting will be used if that setting is not specified.

FieldDescriptionValuesExamplesDefault
imagesan array of images to use in the slideshow.
Each element should be either a path to an image or an array in the form of [path, caption]
widthwidth of the slideshow containerinteger
pixel value
percent
800
"800px"
"50%"
"100%"
heightheight of the slideshow containerinteger
pixel value
400
"400px"
change height dynamically with images
scalehow smaller images are handled."fill"
enlarge each image to completely fill the slideshow container, even if some of it is cut off

"fit"
enlarge smaller images so that they touch the slideshow container on two sides

"none"
do not enlarge any images.

(Images will always be shrunk if they are larger than the slideshow container)
"none"
backgroundbackground color of the slideshow containercss color value
"none"
"black"
"#000000"
"none"
"none"
clickdefines the click areas that control slideshow movementfalse
clicking on the image will be disabled

integer or pixel value
the boundary between left and right will be placed this many pixels from the left

percent
the boundary between left and right will be placed this far across the container from left to right
false
200 or "200px"
"50%"
150 or 25%, whichever is smaller
speedthe number of milliseconds spent on each image during playbackinteger50005000
transitionthe number of milliseconds taken by transitionsinteger400400
fadeenable fading between imagestrue or falsetrue
slideenable sliding between imagestrue
autoplaythe slideshow will start automatically on pageloadtrue or falsefalse
loopenable looping from the last image to the first imagetrue or falsetrue

Controls

The following settings should be within the controls object in the main settings object.

FieldDescriptionValuesExamplesDefault
disableddisable left/right controls for the whole slideshowtrue or falsefalse
heightheight of each control buttoninteger
pixel value
100
"100px"
100
widthwidth of each control buttoninteger
pixel value
46
"46px"
46
backgroundbackground color of the control buttonscss color value"black"
"#000000"
"black"
opacityopacity of the control buttonsdecimal value between 0 and 10
1
0.5
0.5
roundedamount to round corners of control buttonsinteger
pixel value
5
"5px"
0 (corners not rounded)

Captions

The following settings should be within the captions object in the main settings object.

FieldDescriptionValuesExamplesDefault
disableddisable captions for the whole slideshowtrue or falsefalse
positionvertical position of captions"top" or "bottom""bottom"
alignhorizontal position of captions"left", "right", or "center""center"
text_alignalignment of text within caption box"left", "right", or "center""center"
sizecaption text sizeinteger
point value
14
"14pt"
"medium"
paddingpadding around text in caption boxinteger
pixel value
8
"8px"
8
widthwidth of caption boxinteger
pixel value
percent
800
"800px"
"75%"
"100%"
shrink_widthcaption box will be shrunk to fit text, down to a minimum of this sizeinteger
pixel value
percent
200
"200px"
"30%"
same as width (no shrinking)
colorcolor of caption textcss color value"lightskyblue"
"#87CEFA"
"white"
backgroundbackground color of caption boxcss color value"black"
"#000000"
"black"
opacityopacity of caption boxdecimal value between 0 and 10
1
0.5
0.5
roundedamount to round corners of caption boxinteger
pixel value
5
"5px"
0 (corners not rounded)

API

You can make external JavaScript calls to the slideshow.

CallDescription
jslide('slider_id').moveImage(1);Move to the next image
jslide('slider_id').moveImage(-1);Move to the previous image

More API calls coming soon.