jq-bgslider
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -163,3 +163,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
module.exports = "html {\n overflow-x: hidden;\n}\nbody {\n position: relative;\n overflow-x: hidden;\n}\n.bg-slider-img {\n position: fixed;\n z-index: -1;\n top: 0;\n left: 0;\n height: 100vh;\n width: 100%;\n background-size: cover;\n}\n" | ||
module.exports = "html {\r\n overflow-x: hidden;\r\n}\r\nbody {\r\n position: relative;\r\n overflow-x: hidden;\r\n}\r\n.bg-slider-img {\r\n position: fixed;\r\n z-index: -1;\r\n top: 0;\r\n left: 0;\r\n height: 100vh;\r\n width: 100%;\r\n background-size: cover;\r\n}\r\n" | ||
@@ -166,0 +166,0 @@ /***/ } |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jqBgslider=t():e.jqBgslider=t()}(this,function(){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function o(){function e(){var e=m+1,t=m+2;e>=o.length&&(e-=o.length),t>=o.length&&(t-=o.length),g("#img"+m).animate({left:"-100%"},{duration:d,queue:!1,complete:function(){g("#img"+m).css("left","200%")}}),g("#img"+e).animate({left:"0%"},{duration:d,queue:!1,complete:function(){g("#img"+t).css("left","100%"),m=e}})}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.images,o=void 0===i?["https://i.imgur.com/gz0Yq3E.jpg","https://i.imgur.com/e3Fjb93.jpg","https://i.imgur.com/8FoJQYg.jpg","https://i.imgur.com/PCmutZb.jpg","https://i.imgur.com/mDxMTVJ.jpg","https://i.imgur.com/RW9UPlA.jpg"]:i,r=t.selector,s=void 0===r?"body":r,u=t.animDuration,d=void 0===u?1e3:u,l=t.slideDuration,a=void 0===l?5e3:l;if("undefined"==typeof jQuery)throw new Error("jq-bgslider requires jQuery");var g=jQuery;g("head").append("<style>"+n+"</style>"),o.length<2&&jQuery.error("You must provide at least two images to slide through."),a<1.5*d&&jQuery.error("The slide duration must be at least 50% longer than the animation duration."),o.length<2&&jQuery.error("You must select at least two images."),o.forEach(function(e,t){g(s).append('<div class="bg-slider-img", id="img'+t+'"></div>'),g("#img"+t).css("background-image",'url("'+e+'")'),t<2?g("#img"+t).css("left",100*t+"%"):g("#img"+t).css("left","200%")});var m=0;setInterval(e,a)}Object.defineProperty(t,"__esModule",{value:!0});var n=i(1);t.default=o},function(e,t){e.exports="html {\n overflow-x: hidden;\n}\nbody {\n position: relative;\n overflow-x: hidden;\n}\n.bg-slider-img {\n position: fixed;\n z-index: -1;\n top: 0;\n left: 0;\n height: 100vh;\n width: 100%;\n background-size: cover;\n}\n"}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jqBgslider=t():e.jqBgslider=t()}(this,function(){return function(e){function t(i){if(r[i])return r[i].exports;var o=r[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function i(){function e(){var e=m+1,t=m+2;e>=i.length&&(e-=i.length),t>=i.length&&(t-=i.length),g("#img"+m).animate({left:"-100%"},{duration:d,queue:!1,complete:function(){g("#img"+m).css("left","200%")}}),g("#img"+e).animate({left:"0%"},{duration:d,queue:!1,complete:function(){g("#img"+t).css("left","100%"),m=e}})}var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.images,i=void 0===r?["https://i.imgur.com/gz0Yq3E.jpg","https://i.imgur.com/e3Fjb93.jpg","https://i.imgur.com/8FoJQYg.jpg","https://i.imgur.com/PCmutZb.jpg","https://i.imgur.com/mDxMTVJ.jpg","https://i.imgur.com/RW9UPlA.jpg"]:r,n=t.selector,s=void 0===n?"body":n,u=t.animDuration,d=void 0===u?1e3:u,l=t.slideDuration,a=void 0===l?5e3:l;if("undefined"==typeof jQuery)throw new Error("jq-bgslider requires jQuery");var g=jQuery;g("head").append("<style>"+o+"</style>"),i.length<2&&jQuery.error("You must provide at least two images to slide through."),a<1.5*d&&jQuery.error("The slide duration must be at least 50% longer than the animation duration."),i.length<2&&jQuery.error("You must select at least two images."),i.forEach(function(e,t){g(s).append('<div class="bg-slider-img", id="img'+t+'"></div>'),g("#img"+t).css("background-image",'url("'+e+'")'),t<2?g("#img"+t).css("left",100*t+"%"):g("#img"+t).css("left","200%")});var m=0;setInterval(e,a)}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1);t.default=i},function(e,t){e.exports="html {\r\n overflow-x: hidden;\r\n}\r\nbody {\r\n position: relative;\r\n overflow-x: hidden;\r\n}\r\n.bg-slider-img {\r\n position: fixed;\r\n z-index: -1;\r\n top: 0;\r\n left: 0;\r\n height: 100vh;\r\n width: 100%;\r\n background-size: cover;\r\n}\r\n"}])}); |
{ | ||
"name": "jq-bgslider", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"main": "build/jq-bgslider.min.js", | ||
@@ -9,2 +9,10 @@ "repository": { | ||
}, | ||
"keywords": [ | ||
"jquery-plugin", | ||
"ecosystem:jquery", | ||
"background", | ||
"slider", | ||
"full-page", | ||
"full-screen" | ||
], | ||
"scripts": { | ||
@@ -11,0 +19,0 @@ "webpack": "webpack", |
# jq-bgslider [![npm version](https://badge.fury.io/js/jq-bgslider.svg)](https://www.npmjs.com/package/jq-bgslider) [![Dependency Status](https://david-dm.org/nathanhleung/jq-bgslider.svg)](https://david-dm.org/nathanhleung/jq-bgslider) | ||
A simple full-page jQuery Background slider. | ||
Creates a full-screen sliding image background on your `<body>`. Only 2.13kB minified. | ||
Creates a full-screen sliding image background on your `<body>`. 2.13kB minified. | ||
## Usage | ||
Insert the following at the end of your body tag. | ||
@@ -13,3 +12,3 @@ ### Quick Start | ||
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> | ||
<script src="https://unpkg.com/jq-bgslider@2.0.1/build/jq-bgslider.min.js"></script> | ||
<script src="https://unpkg.com/jq-bgslider@2.0.2/build/jq-bgslider.min.js"></script> | ||
<script> | ||
@@ -62,3 +61,3 @@ // Originally in ES6, so default export is accessed via .default | ||
## Examples | ||
[jq-bgslider Demo](https://xyz.nathanhleung.com/mini-jquery-bgswitcher/) | ||
[jq-bgslider Demo](https://xyz.nathanhleung.com/jq-bgslider/) | ||
@@ -65,0 +64,0 @@ In the demo site, a translucent white overlay is added with the following CSS: |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
105664
78