Skip to content

Commit f1dd438

Browse files
committed
Updating examples
1 parent bae3fd4 commit f1dd438

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Complete option usage with data attributes:
6464

6565
## Examples
6666

67-
Take a look at the [Demo](https://sunil-samuel.github.io/#jquery-rbs)
67+
Take a look at the [Demo](https://sunil-samuel.github.io/index.html#pages/jquery/rbs.html)
6868

6969
The following examples are provided:
7070

@@ -108,18 +108,18 @@ The following are options used to define which background image and transitions
108108
>> The type of animation for the transition effect. Currently only 'fade-in' is implemented.
109109
110110
> **randomize** or **data-randomize** (default: false) [Boolean]
111-
>> true - The images selected for the transition are picked randomly and not sequentially.
112-
>> false - The images selected for the transition are picked sequentially starting from `current`.
111+
>> ***true*** - The images selected for the transition are picked randomly and not sequentially.<br>
112+
>> ***false*** - The images selected for the transition are picked sequentially starting from `current`.
113113
114114
> **initialBackground** or **data-initialBackground** (default: null) [Number, 'random', url]
115-
>> If set to anything other than null, then pick a background image from the list of images for the given element.
116-
>> Number - A number between 0 and the length of the `images` array. [0, images.length). The background of the element is set to this image in the `images` array.
117-
>> 'random' - The word 'random' indicate to pick a random image from the list of images in the `images` array to use as the initial background.
118-
>> image url - The url to an image will be used as the background image for this element.
115+
>> If set to anything other than null, then pick a background image from the list of images for the given element.<br>
116+
>> ***Number*** - A number between 0 and the length of the `images` array. [0, images.length). The background of the element is set to this image in the `images` array.<br>
117+
>> ***'random'*** - The word 'random' indicate to pick a random image from the list of images in the `images` array to use as the initial background.<br>
118+
>> ***image url*** - The url to an image will be used as the background image for this element.
119119
120120
> **debug** or **data-debug** (default: false) [Boolean]
121-
>> true - Print debug messages to the log.console for debugging purposes.
122-
>> false - No debug messages
121+
>> ***true*** - Print debug messages to the console.log for debugging purposes.<br>
122+
>> ***false*** - No debug messages
123123
124124
### Event Handlers
125125

examples/example1.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
$(function() {
1717
$(".bg").bgSlideShow({
1818
current : 1,
19-
debug : true,
20-
randomize : true
19+
debug : false,
20+
randomize : true,
21+
initialBackground : 'random'
2122
});
2223
});
2324
</script>

examples/example2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
data-transitionDelay="5000" data-initialBackground="2">Some data
6060
for widget one</div>
6161
<div class='bg' data-images="gfx/bar.jpg,gfx/clouds.jpg,gfx/swirls.jpg"
62-
data-debug="false" data-transitionDelay="7000"
62+
data-debug="false" data-transitionDelay="7000" data-initialBackground="random"
6363
data-transitionSpeed="3000">Some data for widget two</div>
6464
<div style="height: 30px;">This is a div after the background div
6565
to show that this plugin does not impact any elements after it</div>

examples/example3.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
$(".bg").bgSlideShow({
1818
current : 0,
1919
randomize : false,
20-
images : [ "gfx/circles.jpg", "gfx/hash.jpg", "gfx/leaves.jpg" ]
20+
images : [ "gfx/circles.jpg", "gfx/hash.jpg", "gfx/leaves.jpg" ],
21+
initialBackground : 'random',
22+
transitionDelay:2000
2123
});
2224
});
2325
</script>

src/jquery-bg-slideshow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
var defaultOptions = $.extend({
3838
// Start with element 0 as default. Always 0 based.
39-
current: 0,
39+
current: -1,
4040
// The list of images
4141
images: [],
4242
// Time in ms between the transition from one image to another

0 commit comments

Comments
 (0)