Skip to content

Commit 48b4447

Browse files
committed
Updating readme file with usage information.
1 parent dced8ad commit 48b4447

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
11
# jquery-responsive-background-slideshow
2-
Responsive JQuery Background Slideshow :: Slideshow for the background using JQuery animation
2+
3+
**JQuery Responsive Background Slideshow** :: Slideshow for the background using JQuery animation
4+
5+
JQuery plugin that can create a background slideshow. This plugin works differently than a carousel plugin in that the content of the element do not need to change while the background images changes.
6+
7+
## Usage
8+
9+
```javascript
10+
<script type="text/javascript">
11+
$(function() {
12+
$(".bg").bgSlideShow();
13+
});
14+
</script>
15+
16+
<body>
17+
<div class=".bg">Hello</div>
18+
</body>
19+
```
20+
21+
22+
## Examples
23+
24+
Take a look at the [Demo](https://sunil-samuel.github.io/#jquery-rbs)
25+
26+
The following examples are provided:
27+
28+
* [example1.html](examples/example1.html) :: Random background selection given a list of images for a single div element.
29+
* [example2.html](examples/example2.html) :: Multiple div elements with different transition speed and transition delay.
30+
* [example3.html](examples/example3.html) :: Background slideshow for the body sized element.
31+
32+
## Options and Data Attributes
33+
34+
Each option parameter has a corresponding data attribute so that multiple elements could have different option parameters. The ***data-*** attribute always has the precedence over the options
35+
provide when calling the ***.bgSlideShow({options...})*** plugin.
36+
37+
For instance,
38+
39+
```javascript
40+
$(function () {
41+
$(".bg").bgSlideShow({
42+
transitionSpeed : 3000
43+
});
44+
});
45+
46+
<div class='bg' data-transitionSpeed=5000>content<div>
47+
```
48+
49+
> **current ** or **data-current** (default: 0)
50+
>> 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>
52+
53+
> **image**

src/jquery-bg-slideshow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
(function($) {
3434
$.fn.bgSlideShow = function(options) {
3535
var preloadedImages = new Array();
36+
3637
var defaultOptions = $.extend({
3738
// Start with element 0 as default. Always 0 based.
3839
current: 0,

0 commit comments

Comments
 (0)