Skip to content

Commit 7230e2f

Browse files
committed
Updating code with default values.
1 parent 48b4447 commit 7230e2f

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed

README.md

+41-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<p align='right'>
2+
<small>Sunil Samuel<br>
3+
web_github@sunilsamuel.com<br>
4+
http://www.sunilsamuel.com<br>
5+
https://sunil-samuel.github.io/#jquery-rbs
6+
</small>
7+
</p>
8+
9+
110
# jquery-responsive-background-slideshow
211

312
**JQuery Responsive Background Slideshow** :: Slideshow for the background using JQuery animation
@@ -8,16 +17,40 @@ JQuery plugin that can create a background slideshow. This plugin works differe
817

918
```javascript
1019
<script type="text/javascript">
11-
$(function() {
12-
$(".bg").bgSlideShow();
13-
});
20+
$(function() {
21+
$(".bg").bgSlideShow();
22+
});
1423
</script>
1524

1625
<body>
17-
<div class=".bg">Hello</div>
26+
<div class=".bg">Hello</div>
1827
</body>
1928
```
2029

30+
Complete option usage:
31+
32+
```javascript
33+
<script type="text/javascript">
34+
$(function () {
35+
$(".bg").bgSlideShow({
36+
current : 0,
37+
images : ["../gfx/first.png", "../gfx/second.png"],
38+
transitionDelay : 5000, // 5 seconds
39+
transitionSpeed : 3000, // 3 seconds
40+
transitionEffect : 'fade-in',
41+
randomize : false,
42+
initialBackground : 'random',
43+
debug : true,
44+
eventHandlers : {
45+
beforeInit: myBeforeInitFunc,
46+
afterInit: myAfterInitFunc,
47+
beforeChange : myBeforeChangeFunc,
48+
afterChange : myAfterChangeFunc
49+
}
50+
});
51+
});
52+
</script>
53+
```
2154

2255
## Examples
2356

@@ -46,8 +79,9 @@ $(function () {
4679
<div class='bg' data-transitionSpeed=5000>content<div>
4780
```
4881

49-
> **current ** or **data-current** (default: 0)
82+
> **current ** or **data-current** (default: 0)
5083
>> Given the list of images, current defines which image to use first. If `randomize` is set to `true`, then current is not used.
51-
>>> <div data-current=0>content</div>
84+
>> <div data-current=0>content</div>
5285
53-
> **image**
86+
> **images** or **data-images** (default: [])
87+
>> List of images to use to create the background slideshow.

src/jquery-bg-slideshow.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
// If the initial image should also be rendered by this plugin
5151
// if null - then do not do anything for the first image
5252
// if a number or 'random' or an image url - then use the appropriate image
53-
initialBackground: "random",
53+
initialBackground: null,
5454
// Print console.log debug messages for debug purposes
5555
debug: false,
5656
// Event handlers for different events
@@ -62,7 +62,7 @@
6262
// Event before the existing image is replaced
6363
beforeChange: null,
6464
// Event after the existing image is replaced
65-
afterChangeEvent: null
65+
afterChange: null
6666
}
6767
}, options);
6868

0 commit comments

Comments
 (0)