├── .gitignore ├── CONTRIBUTING.md ├── Gulpfile.js ├── LICENSE.md ├── bower.json ├── dist ├── LICENSE.md ├── README.md ├── images │ ├── bx_loader.gif │ └── controls.png ├── index.html ├── jquery-3.1.1.min.js ├── jquery.bxslider.css ├── jquery.bxslider.js ├── jquery.bxslider.min.css ├── jquery.bxslider.min.js └── vendor │ ├── jquery.easing.1.3.js │ └── jquery.fitvids.js ├── package-lock.json ├── package.json ├── readme.md └── src ├── css └── jquery.bxslider.css ├── images ├── bx_loader.gif └── controls.png ├── js └── jquery.bxslider.js └── vendor ├── jquery.easing.1.3.js └── jquery.fitvids.js /.gitignore: -------------------------------------------------------------------------------- 1 | jscs.report.txt 2 | /docs/ 3 | /bower_components/ 4 | .DS_Store 5 | /node_modules 6 | jquery.bxslider.zip 7 | npm-debug.log 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this project 2 | 3 | Please take a moment to review this document in order to make the contribution 4 | process easy and effective for everyone involved. 5 | 6 | Following these guidelines helps to communicate that you respect the time of 7 | the developers managing and developing this open source project. In return, 8 | they should reciprocate that respect in addressing your issue or assessing 9 | patches and features. 10 | 11 | 12 | ## Using the issue tracker 13 | 14 | The issue tracker is the preferred channel for [bug reports](#bugs), 15 | [features requests](#features) and [submitting pull 16 | requests](#pull-requests), but please respect the following restrictions: 17 | 18 | * Please **do not** use the issue tracker for personal support requests. 19 | 20 | * Please **do not** derail or troll issues. Keep the discussion on topic and 21 | respect the opinions of others. 22 | 23 | 24 | 25 | ## Bug reports 26 | 27 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 28 | Good bug reports are extremely helpful - thank you! 29 | 30 | Guidelines for bug reports: 31 | 32 | 1. **Use the GitHub issue search** — check if the issue has already been 33 | reported. 34 | 35 | 2. **Check if the issue has been fixed** — try to reproduce it using the 36 | latest `master` or development branch in the repository. 37 | 38 | 3. **Isolate the problem** — make sure that the code in the repository is 39 | _definitely_ responsible for the issue. 40 | 41 | A good bug report shouldn't leave others needing to chase you up for more 42 | information. Please try to be as detailed as possible in your report. Examples are 43 | important, please try to provide them. 44 | 45 | 46 | 47 | ## Feature requests 48 | 49 | Feature requests are welcome. But take a moment to find out whether your idea 50 | fits with the scope and aims of the project. It's up to *you* to make a strong 51 | case to convince the developers of the merits of this feature. Please 52 | provide as much detail and context as possible. 53 | 54 | 55 | 56 | ## Pull requests 57 | 58 | Good pull requests - patches, improvements, new features - are a fantastic 59 | help. They should remain focused in scope and avoid containing unrelated 60 | commits. 61 | 62 | **Please ask first** before embarking on any significant pull request (e.g. 63 | implementing features, refactoring code), otherwise you risk spending a lot of 64 | time working on something that the developers might not want to merge into the 65 | project. 66 | 67 | Please adhere to the coding conventions used throughout the project (indentation, 68 | comments, etc.). 69 | 70 | Adhering to the following this process is the best way to get your work 71 | merged: 72 | 73 | 1. [Fork](http://help.github.com/fork-a-repo/) the repo, clone your fork, 74 | and configure the remotes: 75 | 76 | ```bash 77 | # Clone your fork of the repo into the current directory 78 | git clone https://github.com// 79 | # Navigate to the newly cloned directory 80 | cd 81 | # Assign the original repo to a remote called "upstream" 82 | git remote add upstream https://github.com// 83 | ``` 84 | 85 | 2. If you cloned a while ago, get the latest changes from upstream: 86 | 87 | ```bash 88 | git checkout 89 | git pull upstream 90 | ``` 91 | 92 | 3. Create a new topic branch (off the main project development branch) to 93 | contain your feature, change, or fix: 94 | 95 | ```bash 96 | git checkout -b 97 | ``` 98 | 99 | 4. Commit your changes in logical chunks. Please adhere to these [git commit 100 | message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 101 | or your code is unlikely be merged into the main project. Use Git's 102 | [interactive rebase](https://help.github.com/articles/interactive-rebase) 103 | feature to tidy up your commits before making them public. 104 | 105 | 5. Locally merge (or rebase) the upstream development branch into your topic branch: 106 | 107 | ```bash 108 | git pull [--rebase] upstream 109 | ``` 110 | 111 | 6. Push your topic branch up to your fork: 112 | 113 | ```bash 114 | git push origin 115 | ``` 116 | 117 | 10. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 118 | with a clear title and description. 119 | -------------------------------------------------------------------------------- /Gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp') 2 | var uglify = require('gulp-uglify'); 3 | var cssmin = require('gulp-cssmin'); 4 | var rename = require('gulp-rename'); 5 | 6 | gulp.task('js-minify', function (done) { 7 | gulp.src('./src/js/jquery.bxslider.js') 8 | .pipe(uglify({ 9 | preserveComments: 'license' 10 | })) 11 | .pipe(rename({ suffix: '.min' })) 12 | .pipe(gulp.dest('./dist')); 13 | done(); 14 | }); 15 | 16 | gulp.task('js-copy-src', function (done) { 17 | gulp.src('./src/js/jquery.bxslider.js') 18 | .pipe(gulp.dest('./dist')); 19 | done(); 20 | }); 21 | 22 | gulp.task('css-minify', function (done) { 23 | gulp.src('./src/css/jquery.bxslider.css') 24 | .pipe(cssmin()) 25 | .pipe(rename({ suffix: '.min' })) 26 | .pipe(gulp.dest('./dist')); 27 | done(); 28 | }); 29 | 30 | gulp.task('css-copy-src', function (done) { 31 | gulp.src('./src/css/jquery.bxslider.css') 32 | .pipe(gulp.dest('./dist')); 33 | done(); 34 | }); 35 | 36 | gulp.task('vendor-copy-src', function (done) { 37 | gulp.src('./src/vendor/*') 38 | .pipe(gulp.dest('./dist/vendor')); 39 | done(); 40 | }); 41 | 42 | gulp.task('images-copy-src', function (done) { 43 | gulp.src('./src/images/*') 44 | .pipe(gulp.dest('./dist/images')); 45 | done(); 46 | }); 47 | 48 | gulp.task('docs-copy-src', function (done) { 49 | gulp.src([ 50 | './readme.md', 51 | './LICENSE.md' 52 | ]) 53 | .pipe(gulp.dest('./dist')); 54 | done(); 55 | }); 56 | 57 | gulp.task('default', gulp.series( 58 | 'js-minify', 59 | 'js-copy-src', 60 | 'css-minify', 61 | 'css-copy-src', 62 | 'vendor-copy-src', 63 | 'images-copy-src', 64 | 'docs-copy-src' 65 | )); 66 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | License 2 | ------- 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright © 2014 [Steven Wanderski](https://twitter.com/stevenwanderski) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bxslider-4", 3 | "homepage": "http://bxslider.com", 4 | "license": "MIT", 5 | "main": [ 6 | "dist/jquery.bxslider.js", 7 | "dist/jquery.bxslider.css", 8 | "dist/images/bx_loader.gif", 9 | "dist/images/controls.png" 10 | ], 11 | "ignore": [ 12 | "docs_src/*", 13 | "docs/*" 14 | ], 15 | "keywords": [ 16 | "bxslider", 17 | "javascript", 18 | "jquery", 19 | "library" 20 | ], 21 | "dependencies": { 22 | "jquery": ">= 1.8.3" 23 | }, 24 | "devDependencies": { 25 | "bootstrap": ">= 3.3.2", 26 | "highlightjs": "~8.4.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dist/LICENSE.md: -------------------------------------------------------------------------------- 1 | License 2 | ------- 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright © 2014 [Steven Wanderski](https://twitter.com/stevenwanderski) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | # bxSlider 4.2.17 2 | ## The fully-loaded, responsive jQuery content slider 3 | 4 | ### Why should I use this slider? 5 | * Fully responsive - will adapt to any device 6 | * Horizontal, vertical, and fade modes 7 | * Slides can contain images, video, or HTML content 8 | * Full callback API and public methods 9 | * Small file size, fully themed, simple to implement 10 | * Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+ 11 | * Tons of configuration options 12 | 13 | For complete documentation, tons of examples, and a good time, visit: [http://bxslider.com](http://bxslider.com) 14 | 15 | Written by: Steven Wanderski - [http://stevenwanderski.com](http://stevenwanderski.com) 16 | 17 | ### License 18 | Released under the MIT license - http://opensource.org/licenses/MIT 19 | 20 | Let's get on with it! 21 | 22 | ## Installation 23 | 24 | ### Step 1: Link required files 25 | 26 | First and most important, the jQuery library needs to be included (no need to download - link directly from Google). Next, download the package from this site and link the bxSlider CSS file (for the theme) and the bxSlider Javascript file. 27 | 28 | ```html 29 | 30 | 31 | 32 | 33 | 34 | 35 | ``` 36 | 37 | Or, if you prefer, you can get the bxSlider's resources from the **CDN**: 38 | 39 | ```html 40 | 41 | 42 | ``` 43 | 44 | ### Step 2: Create HTML markup 45 | 46 | Create a `
    ` element, with a `
  • ` for each slide. Slides can contain images, video, or any other HTML content! 47 | 48 | ```html 49 |
      50 |
    • 51 |
    • 52 |
    • 53 |
    • 54 |
    55 | ``` 56 | 57 | ### Step 3: Call the bxSlider 58 | 59 | Call .bxSlider() on `
      `. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work! 60 | 61 | ```javascript 62 | $(document).ready(function(){ 63 | $('.bxslider').bxSlider(); 64 | }); 65 | ``` 66 | 67 | ## Configuration options 68 | 69 | ### General 70 | 71 | **mode** 72 | 73 | Type of transition between slides 74 | ``` 75 | default: 'horizontal' 76 | options: 'horizontal', 'vertical', 'fade' 77 | ``` 78 | 79 | **speed** 80 | 81 | Slide transition duration (in ms) 82 | ``` 83 | default: 500 84 | options: integer 85 | ``` 86 | 87 | **slideMargin** 88 | 89 | Margin between each slide 90 | ``` 91 | default: 0 92 | options: integer 93 | ``` 94 | 95 | **startSlide** 96 | 97 | Starting slide index (zero-based) 98 | ``` 99 | default: 0 100 | options: integer 101 | ``` 102 | 103 | **randomStart** 104 | 105 | Start slider on a random slide 106 | ``` 107 | default: false 108 | options: boolean (true / false) 109 | ``` 110 | 111 | **slideSelector** 112 | 113 | Element to use as slides (ex. 'div.slide').
      Note: by default, bxSlider will use all immediate children of the slider element 114 | ``` 115 | default: '' 116 | options: jQuery selector 117 | ``` 118 | 119 | **infiniteLoop** 120 | 121 | If true, clicking "Next" while on the last slide will transition to the first slide and vice-versa 122 | ``` 123 | default: true 124 | options: boolean (true / false) 125 | ``` 126 | 127 | **hideControlOnEnd** 128 | 129 | If true, "Prev" and "Next" controls will receive a class disabled when slide is the first or the last
      Note: Only used when infiniteLoop: false 130 | ``` 131 | default: false 132 | options: boolean (true / false) 133 | ``` 134 | 135 | **easing** 136 | 137 | The type of "easing" to use during transitions. If using CSS transitions, include a value for the transition-timing-function property. If not using CSS transitions, you may include plugins/jquery.easing.1.3.js for many options.
      See http://gsgd.co.uk/sandbox/jquery/easing/ for more info. 138 | ``` 139 | default: null 140 | options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options) 141 | ``` 142 | 143 | **captions** 144 | 145 | Include image captions. Captions are derived from the image's title attribute 146 | ``` 147 | default: false 148 | options: boolean (true / false) 149 | ``` 150 | 151 | **ticker** 152 | 153 | Use slider in ticker mode (similar to a news ticker) 154 | ``` 155 | default: false 156 | options: boolean (true / false) 157 | ``` 158 | 159 | **tickerHover** 160 | 161 | Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions! 162 | ``` 163 | default: false 164 | options: boolean (true / false) 165 | ``` 166 | 167 | **adaptiveHeight** 168 | 169 | Dynamically adjust slider height based on each slide's height 170 | ``` 171 | default: false 172 | options: boolean (true / false) 173 | ``` 174 | 175 | **adaptiveHeightSpeed** 176 | 177 | Slide height transition duration (in ms). Note: only used if adaptiveHeight: true 178 | ``` 179 | default: 500 180 | options: integer 181 | ``` 182 | 183 | **video** 184 | 185 | If any slides contain video, set this to true. Also, include plugins/jquery.fitvids.js
      See http://fitvidsjs.com/ for more info 186 | ``` 187 | default: false 188 | options: boolean (true / false) 189 | ``` 190 | 191 | **responsive** 192 | 193 | Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders. 194 | ``` 195 | default: true 196 | options: boolean (true /false) 197 | ``` 198 | 199 | **useCSS** 200 | 201 | If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used. 202 | ``` 203 | default: true 204 | options: boolean (true / false) 205 | ``` 206 | 207 | **preloadImages** 208 | 209 | If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions) 210 | ``` 211 | default: 'visible' 212 | options: 'all', 'visible', 'none' 213 | ``` 214 | 215 | **touchEnabled** 216 | 217 | If true, slider will allow touch swipe transitions 218 | ``` 219 | default: true 220 | options: boolean (true / false) 221 | ``` 222 | 223 | **swipeThreshold** 224 | 225 | Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if touchEnabled: true 226 | ``` 227 | default: 50 228 | options: integer 229 | ``` 230 | 231 | **oneToOneTouch** 232 | 233 | If true, non-fade slides follow the finger as it swipes 234 | ``` 235 | default: true 236 | options: boolean (true / false) 237 | ``` 238 | 239 | **preventDefaultSwipeX** 240 | 241 | If true, touch screen will not move along the x-axis as the finger swipes 242 | ``` 243 | default: true 244 | options: boolean (true / false) 245 | ``` 246 | 247 | **preventDefaultSwipeY** 248 | 249 | If true, touch screen will not move along the y-axis as the finger swipes 250 | ``` 251 | default: false 252 | options: boolean (true / false) 253 | ``` 254 | 255 | **wrapperClass** 256 | 257 | Class to wrap the slider in. Change to prevent from using default bxSlider styles. 258 | ``` 259 | default: 'bx-wrapper' 260 | options: string 261 | ``` 262 | 263 | ### Pager 264 | 265 | **pager** 266 | 267 | If true, a pager will be added 268 | ``` 269 | default: true 270 | options: boolean (true / false) 271 | ``` 272 | 273 | **pagerType** 274 | 275 | If 'full', a pager link will be generated for each slide. If 'short', a x / y pager will be used (ex. 1 / 5) 276 | ``` 277 | default: 'full' 278 | options: 'full', 'short' 279 | ``` 280 | 281 | **pagerShortSeparator** 282 | 283 | If pagerType: 'short', pager will use this value as the separating character 284 | ``` 285 | default: ' / ' 286 | options: string 287 | ``` 288 | 289 | **pagerSelector** 290 | 291 | Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport 292 | ``` 293 | default: '' 294 | options: jQuery selector 295 | ``` 296 | 297 | **pagerCustom** 298 | 299 | Parent element to be used as the pager. Parent element must contain a <a data-slide-index="x"> element for each slide. See example here. Not for use with dynamic carousels. 300 | ``` 301 | default: null 302 | options: jQuery selector 303 | ``` 304 | 305 | **buildPager** 306 | 307 | If supplied, function is called on every slide element, and the returned value is used as the pager item markup.
      See examples for detailed implementation 308 | ``` 309 | default: null 310 | options: function(slideIndex) 311 | ``` 312 | 313 | ### Controls 314 | 315 | **controls** 316 | 317 | If true, "Next" / "Prev" controls will be added 318 | ``` 319 | default: true 320 | options: boolean (true / false) 321 | ``` 322 | 323 | **nextText** 324 | 325 | Text to be used for the "Next" control 326 | ``` 327 | default: 'Next' 328 | options: string 329 | ``` 330 | 331 | **prevText** 332 | 333 | Text to be used for the "Prev" control 334 | ``` 335 | default: 'Prev' 336 | options: string 337 | ``` 338 | 339 | **nextSelector** 340 | 341 | Element used to populate the "Next" control 342 | ``` 343 | default: null 344 | options: jQuery selector 345 | ``` 346 | 347 | **prevSelector** 348 | 349 | Element used to populate the "Prev" control 350 | ``` 351 | default: null 352 | options: jQuery selector 353 | ``` 354 | 355 | **autoControls** 356 | 357 | If true, "Start" / "Stop" controls will be added 358 | ``` 359 | default: false 360 | options: boolean (true / false) 361 | ``` 362 | 363 | **startText** 364 | 365 | Text to be used for the "Start" control 366 | ``` 367 | default: 'Start' 368 | options: string 369 | ``` 370 | 371 | **stopText** 372 | 373 | Text to be used for the "Stop" control 374 | ``` 375 | default: 'Stop' 376 | options: string 377 | ``` 378 | 379 | **autoControlsCombine** 380 | 381 | When slideshow is playing only "Stop" control is displayed and vice-versa 382 | ``` 383 | default: false 384 | options: boolean (true / false) 385 | ``` 386 | 387 | **autoControlsSelector** 388 | 389 | Element used to populate the auto controls 390 | ``` 391 | default: null 392 | options: jQuery selector 393 | ``` 394 | 395 | **keyboardEnabled** 396 | 397 | Enable keyboard navigation for visible sliders 398 | ``` 399 | default: false 400 | options: boolean (true / false) 401 | ``` 402 | 403 | ### Auto 404 | 405 | **auto** 406 | 407 | Slides will automatically transition 408 | ``` 409 | default: false 410 | options: boolean (true / false) 411 | ``` 412 | **stopAutoOnClick** 413 | 414 | Auto will stop on interaction with controls 415 | ``` 416 | default: false 417 | options: boolean (true / false) 418 | ``` 419 | 420 | **pause** 421 | 422 | The amount of time (in ms) between each auto transition 423 | ``` 424 | default: 4000 425 | options: integer 426 | ``` 427 | 428 | **autoStart** 429 | 430 | Auto show starts playing on load. If false, slideshow will start when the "Start" control is clicked 431 | ``` 432 | default: true 433 | options: boolean (true / false) 434 | ``` 435 | 436 | **autoDirection** 437 | 438 | The direction of auto show slide transitions 439 | ``` 440 | default: 'next' 441 | options: 'next', 'prev' 442 | ``` 443 | 444 | **autoHover** 445 | 446 | Auto show will pause when mouse hovers over slider 447 | ``` 448 | default: false 449 | options: boolean (true / false) 450 | ``` 451 | 452 | **autoDelay** 453 | 454 | Time (in ms) auto show should wait before starting 455 | ``` 456 | default: 0 457 | options: integer 458 | ``` 459 | 460 | ### Carousel 461 | 462 | **minSlides** 463 | 464 | The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size. 465 | ``` 466 | default: 1 467 | options: integer 468 | ``` 469 | 470 | **maxSlides** 471 | 472 | The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size. 473 | ``` 474 | default: 1 475 | options: integer 476 | ``` 477 | 478 | **moveSlides** 479 | 480 | The number of slides to move on transition. This value must be `>= minSlides`, and `<= maxSlides`. If zero (default), the number of fully-visible slides will be used. 481 | ``` 482 | default: 0 483 | options: integer 484 | ``` 485 | 486 | **slideWidth** 487 | 488 | The width of each slide. This setting is required for all horizontal carousels! 489 | ``` 490 | default: 0 491 | options: integer 492 | ``` 493 | 494 | **shrinkItems** 495 | 496 | The Carousel will only show whole items and shrink the images to fit the viewport based on maxSlides/MinSlides. 497 | ``` 498 | default: false 499 | options: boolean (true / false) 500 | ``` 501 | 502 | ### Keyboard 503 | 504 | **keyboardEnabled** 505 | 506 | Allows for keyboard control of visible slider. Keypress ignored if slider not visible. 507 | ``` 508 | default: false 509 | options: boolean (true / false) 510 | ``` 511 | 512 | ### Accessibility 513 | 514 | **ariaLive** 515 | 516 | Adds Aria Live attribute to slider. 517 | ``` 518 | default: true 519 | options: boolean (true / false) 520 | ``` 521 | 522 | **ariaHidden** 523 | 524 | Adds Aria Hidden attribute to any nonvisible slides. 525 | ``` 526 | default: true 527 | options: boolean (true / false) 528 | ``` 529 | 530 | ### Callbacks 531 | 532 | **onSliderLoad** 533 | 534 | Executes immediately after the slider is fully loaded 535 | ``` 536 | default: function(){} 537 | options: function(currentIndex){ // your code here } 538 | arguments: 539 | currentIndex: element index of the current slide 540 | ``` 541 | 542 | **onSliderResize** 543 | 544 | Executes immediately after the slider is resized 545 | ``` 546 | default: function(){} 547 | options: function(currentIndex){ // your code here } 548 | arguments: 549 | currentIndex: element index of the current slide 550 | ``` 551 | 552 | **onSlideBefore** 553 | 554 | Executes immediately before each slide transition. 555 | ``` 556 | default: function(){} 557 | options: function($slideElement, oldIndex, newIndex){ // your code here } 558 | arguments: 559 | $slideElement: jQuery element of the destination element 560 | oldIndex: element index of the previous slide (before the transition) 561 | newIndex: element index of the destination slide (after the transition) 562 | ``` 563 | 564 | **onSlideAfter** 565 | 566 | Executes immediately after each slide transition. Function argument is the current slide element (when transition completes). 567 | ``` 568 | default: function(){} 569 | options: function($slideElement, oldIndex, newIndex){ // your code here } 570 | arguments: 571 | $slideElement: jQuery element of the destination element 572 | oldIndex: element index of the previous slide (before the transition) 573 | newIndex: element index of the destination slide (after the transition) 574 | ``` 575 | 576 | **onSlideNext** 577 | 578 | Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element. 579 | ``` 580 | default: function(){} 581 | options: function($slideElement, oldIndex, newIndex){ // your code here } 582 | arguments: 583 | $slideElement: jQuery element of the destination element 584 | oldIndex: element index of the previous slide (before the transition) 585 | newIndex: element index of the destination slide (after the transition) 586 | ``` 587 | 588 | **onSlidePrev** 589 | 590 | Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element. 591 | ``` 592 | default: function(){} 593 | options: function($slideElement, oldIndex, newIndex){ // your code here } 594 | arguments: 595 | $slideElement: jQuery element of the destination element 596 | oldIndex: element index of the previous slide (before the transition) 597 | newIndex: element index of the destination slide (after the transition) 598 | ``` 599 | 600 | **onAutoChange** 601 | 602 | Executes immediately after auto transtion starts or stops. 603 | ``` 604 | default: function(){} 605 | options: function(state){ // your code here } 606 | arguments: 607 | state: the new state of "auto": boolean (true / false) 608 | ``` 609 | 610 | ### Public methods 611 | 612 | **goToSlide** 613 | 614 | Performs a slide transition to the supplied slide index (zero-based) 615 | ``` 616 | example: 617 | slider = $('.bxslider').bxSlider(); 618 | slider.goToSlide(3); 619 | ``` 620 | 621 | **goToNextSlide** 622 | 623 | Performs a "Next" slide transition 624 | ``` 625 | example: 626 | slider = $('.bxslider').bxSlider(); 627 | slider.goToNextSlide(); 628 | ``` 629 | 630 | **goToPrevSlide** 631 | 632 | Performs a "Prev" slide transition 633 | ``` 634 | example: 635 | slider = $('.bxslider').bxSlider(); 636 | slider.goToPrevSlide(); 637 | ``` 638 | 639 | **startAuto** 640 | Starts the auto show. Provide an argument `false` to prevent the auto controls from being updated. 641 | ``` 642 | example: 643 | slider = $('.bxslider').bxSlider(); 644 | slider.startAuto(); 645 | ``` 646 | 647 | **stopAuto** 648 | 649 | Stops the auto show. Provide an argument `false` to prevent the auto controls from being updated. 650 | ``` 651 | example: 652 | slider = $('.bxslider').bxSlider(); 653 | slider.stopAuto(); 654 | ``` 655 | 656 | **getCurrentSlide** 657 | 658 | Returns the current active slide 659 | ``` 660 | example: 661 | slider = $('.bxslider').bxSlider(); 662 | var current = slider.getCurrentSlide(); 663 | ``` 664 | 665 | **getSlideCount** 666 | 667 | Returns the total number of slides in the slider 668 | ``` 669 | example: 670 | slider = $('.bxslider').bxSlider(); 671 | var slideQty = slider.getSlideCount(); 672 | ``` 673 | 674 | **redrawSlider** 675 | 676 | Redraw the slider. Useful when needing to redraw a hidden slider after it is unhidden. 677 | ``` 678 | example: 679 | slider = $('.bxslider').bxSlider(); 680 | slider.redrawSlider(); 681 | ``` 682 | 683 | **reloadSlider** 684 | 685 | Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. 686 | ``` 687 | example: 688 | slider = $('.bxslider').bxSlider(); 689 | slider.reloadSlider(); 690 | ``` 691 | 692 | **destroySlider** 693 | 694 | Destroy the slider. This reverts all slider elements back to their original state (before calling the slider). 695 | ``` 696 | example: 697 | slider = $('.bxslider').bxSlider(); 698 | slider.destroySlider(); 699 | ``` 700 | 701 | ### Local Development with Gulp 702 | 703 | **Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding. 704 | 705 | From the command line: 706 | 707 | 1. Install the CLI: `npm install --global gulp-cli` 708 | 2. Run `npm install` to install local development tools 709 | 3. Run `gulp` which will build the project 710 | 711 | ## Contributing 712 | 713 | Everyone is welcome to help [contribute](CONTRIBUTING.md) and improve this project. There are several ways you can contribute: 714 | 715 | * Reporting issues (please read [issue guidelines](https://github.com/necolas/issue-guidelines)) 716 | * Suggesting new features 717 | * Writing or refactoring code 718 | * Fixing [issues](https://github.com/roots/roots/issues) 719 | 720 | ## Changelog 721 | 722 | ### Version 4.2.14 723 | * Fixing flickering (on -webkit) when used background-image to instead of 724 | * FIX calling API method stopAuto() 725 | * InvalidPointerId on Android 6 726 | * Use jQuery.fn.on instead of jQuery.fn.bind #1126 727 | * InvalidPointerId on Android 6 728 | 729 | ### Version 4.2.13 730 | * Fix error pagerqty 731 | * Fix the problem #48 in the version 4.2.5 when using YUI Compressor 732 | * Fix division by 0 733 | * Ensure that slider.working is set to false at the end of goToSlide(), regardless of what happened with position. 734 | * Add Callback for when Auto changes... 735 | * Fix for Firefox59 and PointerEvent standard compatibility 736 | * Fix for middle mouse click 737 | * Fix typo 738 | * Format the license in package.json to match the SPDX standard 739 | * Code formatting 740 | 741 | ### Version 4.2.12 742 | * Fixes auto control theme 743 | 744 | ### Version 4.2.11 745 | * Removes auto-centering for sliders with no pager or controls 746 | 747 | ### Version 4.2.10 748 | * Bumps npm and bower versions 749 | 750 | ### Version 4.2.9 751 | * Removes node engine version requirement 752 | 753 | ### Version 4.2.8 754 | * Removes auto-centering from the theme file (`jquery.bxslider.css`) 755 | 756 | ### Version 4.2.7 757 | * Allows new version to be published to NPM 758 | 759 | ### Version 4.2.6 760 | * Fix: jQuery 3 support 761 | * Adds Gulp and removes Grunt (for easier local development) 762 | 763 | ### Version 4.2.5 764 | * Fix: Vertical carousel minSlides not working #840 765 | * Fix: slider breaks with css animations if settings.speed set to 0 #838 766 | * Fix: Slider runs into undefined state when reloadSlider is called before initialization was finished #833 767 | 768 | ### Version 4.2.4 769 | 770 | NOTICE: We have switched to a Grunt based build process in order to leverage [Assemble](http://assemble.io) for local documentation building. Please review the above notes about Grunt for the commands available. 771 | 772 | * Fix: Fixed transition from first to last slide during infinite loop #778 773 | * Fix: Reload on multiple sliders doesn't work? #755 774 | * Fix: bxSlider with text only #746 775 | * Fix: bower missing main and ignore entries #738 776 | * Fix: Tickermode transitionend event bubbling #737 777 | * Fix: Initializing before destroyed breaks slider #748 778 | * Enhancement: Added shrinkItems carousel setting #772 779 | * Enhancement: Maintain auto display of slides after a manual selection #594 780 | * Enhancement: Slider getter through jquery object #739 781 | * Enhancement: Add aria attributes #751 782 | * Enhancement: Slider element in every callback and a new method getSliderElement (#780) 783 | * Enhancement: Local Documentiation and examples. I have added buildable documentation to the repo. This will expand over time and allow for community corrections as needed. Please see above Grunt notes on how to build. 784 | 785 | 786 | ### Version 4.2.3 787 | * Minor bug fix 788 | 789 | ### Version 4.2.2 790 | * Fix: Remove unused plugin variable (#733) 791 | * Fix: `updateAfterSlideTransition` not being called (#704) 792 | * Fix: Slider stops auto advancing (#702) 793 | * Fix: Refresh page, slider show the last item at the first in mode: 'horizontal' (#694) 794 | * Fix: horizintal ticker stutters on loop (#669) 795 | * Fix: Wrong bx-wrapper bottom margin with controls=true and pager=false (#647) 796 | * Fix: add css tickerHover. (#629) 797 | * Fix: Slider refusing to scale down, only up (#611) 798 | * Fix: bxSlider freezes on touch devices (#540) 799 | * Fix: Multiple fixes and improvements for Windows Mobile Devices (#596) 800 | * Fix: Accessing bxslider's slider object inside its “onSliderLoad” callback returns undefined (#475) 801 | * Fix: infiniteLoop glitch when scrolling from first to last slide (#429) 802 | * Enhancement: Cancel transitions on callbacks by returning false. (#411) 803 | * Enhancement: Added Keyboard arrow left and right support (#239) 804 | 805 | ### Version 4.2.1 806 | * Fix: Merge Conflict in dist 807 | * Fix: modified bower.json 808 | 809 | ### Version 4.2.0 810 | * Fix: Reverse #714, fixes #722. 811 | * Fix: Repo Tag #729 812 | * Fix: #720 pagerCustom issues 813 | 814 | 4.2.0 Introduces a streamlined build process using [gulp](www.gulpjs.com). Along with this new build process the projects folder structure has been changed. You will find a `dist` folder with all assets ready to use, including both minified and unminified versions of the javascript. These assets should be ready to go. In `src` you will find the uncompiled assets, including a new less version of the css for bxslider. This is an important step for bxslider. It will help speed development up and keep work clean. It also paves the way for a big revamp we have planned in the future. 815 | 816 | **Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding. 817 | 818 | From the command line: 819 | 820 | 1. Install [gulp](http://gulpjs.com) globally with `npm install -g gulp` 821 | 2. Navigate to the project directory, then run `npm install` 822 | 823 | You now have all the necessary dependencies to run the build process. 824 | 825 | ### Available gulp commands 826 | 827 | * `gulp` — Compile and optimize all files to `dist` 828 | * `gulp styles` — Compile css assets only to `dist` 829 | * `gulp scripts` — Compile js assets only to `dist` 830 | * `gulp images` - Run lossless compression on all the images and copy to `dist` 831 | * `gulp jshint` — Checks JS and JSON code for errors based on our .jshintrc settings 832 | 833 | 834 | ### Version 4.1.3 835 | * Fix: responsive issue for horizontal mode for issue #611, #714 836 | * Fix: extra space on the left when using fade mode. #715 837 | * Fix: wrongly removing custom pager in destroySlider #610 838 | * Fix: bug with reloading slider with custom pager #545 839 | * Fix: Issue with infinite scroll sometimes returning to 0 #481 840 | * Fix: When "infiniteLoop" is used, true is not passed to a clone method. #346 841 | * Fix: "pagerCustom" won't work when using reloadSlider #171 842 | * Fix: Remove vendor prefix for translateZ(0) #565 843 | * Fix: give styles on focus for accessibility #228 844 | * Fix: Minified Version out of sync. 845 | * Fix: Remove -5px left #517 846 | * Enhancement: Invert order call of appendControls() and appendPager() #226 847 | * Enhancement: Various Indentation and typos in docs fixed. #551, #578 848 | * Enhancement: Update jsDelivr with update.json for autoupdate of CDN 849 | * Enhancement: Tag Repo so it can be included in CDNJS 850 | * Created development branch to work from. Eventually will restructure entire repo to follow best practice setup. 851 | 852 | 853 | ### Version 4.1.2 854 | * Added `bower.json` configuration file. Manage bxSlider as a dependency using [bower](http://bower.io/). 855 | 856 | ### Version 4.1.1 857 | * Removed imagesLoaded library and added iframe preloading support 858 | * Added responsive option - setting to false will prevent $(window).resize binding 859 | 860 | ### Version 4.1 861 | * Carousel mode (minSlides / maxSlides) was re-written to be more intuitive. 862 | * SlideWidth now acts as it should (slides respect the width value). 863 | * SlideWidth now properly parsed: accepts string ("600px") or integer (600). 864 | * Slider now only needs to load visible slides (by default) in order to initialize which results in much faster loading. A "preloadImages" setting allows for configuration. 865 | 866 | 867 | Long live Zep. 868 | -------------------------------------------------------------------------------- /dist/images/bx_loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenwanderski/bxslider-4/ed3ac54d1d3c1ae823689f614235955f5ae54fe4/dist/images/bx_loader.gif -------------------------------------------------------------------------------- /dist/images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenwanderski/bxslider-4/ed3ac54d1d3c1ae823689f614235955f5ae54fe4/dist/images/controls.png -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
        5 |
      • 6 |
      • 7 |
      • 8 |
      • 9 |
      • 10 |
      11 | 12 | 13 | 14 | 15 | 16 | 30 | -------------------------------------------------------------------------------- /dist/jquery.bxslider.css: -------------------------------------------------------------------------------- 1 | /** VARIABLES 2 | ===================================*/ 3 | /** RESET AND LAYOUT 4 | ===================================*/ 5 | .bx-wrapper { 6 | position: relative; 7 | margin-bottom: 60px; 8 | padding: 0; 9 | *zoom: 1; 10 | -ms-touch-action: pan-y; 11 | touch-action: pan-y; 12 | } 13 | .bx-wrapper img { 14 | max-width: 100%; 15 | display: block; 16 | } 17 | .bxslider { 18 | margin: 0; 19 | padding: 0; 20 | /*fix flickering when used background-image instead of (on Chrome)*/ 21 | -webkit-perspective: 1000; 22 | } 23 | ul.bxslider { 24 | list-style: none; 25 | } 26 | .bx-viewport { 27 | /* fix other elements on the page moving (in Chrome) */ 28 | -webkit-transform: translateZ(0); 29 | } 30 | /** THEME 31 | ===================================*/ 32 | .bx-wrapper { 33 | -moz-box-shadow: 0 0 5px #ccc; 34 | -webkit-box-shadow: 0 0 5px #ccc; 35 | box-shadow: 0 0 5px #ccc; 36 | border: 5px solid #fff; 37 | background: #fff; 38 | } 39 | .bx-wrapper .bx-pager, 40 | .bx-wrapper .bx-controls-auto { 41 | position: absolute; 42 | bottom: -30px; 43 | width: 100%; 44 | } 45 | /* LOADER */ 46 | .bx-wrapper .bx-loading { 47 | min-height: 50px; 48 | background: url('images/bx_loader.gif') center center no-repeat #ffffff; 49 | height: 100%; 50 | width: 100%; 51 | position: absolute; 52 | top: 0; 53 | left: 0; 54 | z-index: 2000; 55 | } 56 | /* PAGER */ 57 | .bx-wrapper .bx-pager { 58 | text-align: center; 59 | font-size: .85em; 60 | font-family: Arial; 61 | font-weight: bold; 62 | color: #666; 63 | padding-top: 20px; 64 | } 65 | .bx-wrapper .bx-pager.bx-default-pager a { 66 | background: #666; 67 | text-indent: -9999px; 68 | display: block; 69 | width: 10px; 70 | height: 10px; 71 | margin: 0 5px; 72 | outline: 0; 73 | -moz-border-radius: 5px; 74 | -webkit-border-radius: 5px; 75 | border-radius: 5px; 76 | } 77 | .bx-wrapper .bx-pager.bx-default-pager a:hover, 78 | .bx-wrapper .bx-pager.bx-default-pager a.active, 79 | .bx-wrapper .bx-pager.bx-default-pager a:focus { 80 | background: #000; 81 | } 82 | .bx-wrapper .bx-pager-item, 83 | .bx-wrapper .bx-controls-auto .bx-controls-auto-item { 84 | display: inline-block; 85 | vertical-align: bottom; 86 | *zoom: 1; 87 | *display: inline; 88 | } 89 | .bx-wrapper .bx-pager-item { 90 | font-size: 0; 91 | line-height: 0; 92 | } 93 | /* DIRECTION CONTROLS (NEXT / PREV) */ 94 | .bx-wrapper .bx-prev { 95 | left: 10px; 96 | background: url('images/controls.png') no-repeat 0 -32px; 97 | } 98 | .bx-wrapper .bx-prev:hover, 99 | .bx-wrapper .bx-prev:focus { 100 | background-position: 0 0; 101 | } 102 | .bx-wrapper .bx-next { 103 | right: 10px; 104 | background: url('images/controls.png') no-repeat -43px -32px; 105 | } 106 | .bx-wrapper .bx-next:hover, 107 | .bx-wrapper .bx-next:focus { 108 | background-position: -43px 0; 109 | } 110 | .bx-wrapper .bx-controls-direction a { 111 | position: absolute; 112 | top: 50%; 113 | margin-top: -16px; 114 | outline: 0; 115 | width: 32px; 116 | height: 32px; 117 | text-indent: -9999px; 118 | z-index: 9999; 119 | } 120 | .bx-wrapper .bx-controls-direction a.disabled { 121 | display: none; 122 | } 123 | /* AUTO CONTROLS (START / STOP) */ 124 | .bx-wrapper .bx-controls-auto { 125 | text-align: center; 126 | } 127 | .bx-wrapper .bx-controls-auto .bx-start { 128 | display: block; 129 | text-indent: -9999px; 130 | width: 10px; 131 | height: 11px; 132 | outline: 0; 133 | background: url('images/controls.png') -86px -11px no-repeat; 134 | margin: 0 3px; 135 | } 136 | .bx-wrapper .bx-controls-auto .bx-start:hover, 137 | .bx-wrapper .bx-controls-auto .bx-start.active, 138 | .bx-wrapper .bx-controls-auto .bx-start:focus { 139 | background-position: -86px 0; 140 | } 141 | .bx-wrapper .bx-controls-auto .bx-stop { 142 | display: block; 143 | text-indent: -9999px; 144 | width: 9px; 145 | height: 11px; 146 | outline: 0; 147 | background: url('images/controls.png') -86px -44px no-repeat; 148 | margin: 0 3px; 149 | } 150 | .bx-wrapper .bx-controls-auto .bx-stop:hover, 151 | .bx-wrapper .bx-controls-auto .bx-stop.active, 152 | .bx-wrapper .bx-controls-auto .bx-stop:focus { 153 | background-position: -86px -33px; 154 | } 155 | /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */ 156 | .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager { 157 | text-align: left; 158 | width: 80%; 159 | } 160 | .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto { 161 | right: 0; 162 | width: 35px; 163 | } 164 | /* IMAGE CAPTIONS */ 165 | .bx-wrapper .bx-caption { 166 | position: absolute; 167 | bottom: 0; 168 | left: 0; 169 | background: #666; 170 | background: rgba(80, 80, 80, 0.75); 171 | width: 100%; 172 | } 173 | .bx-wrapper .bx-caption span { 174 | color: #fff; 175 | font-family: Arial; 176 | display: block; 177 | font-size: .85em; 178 | padding: 10px; 179 | } 180 | -------------------------------------------------------------------------------- /dist/jquery.bxslider.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bxSlider v4.2.17 3 | * Copyright 2013-2017 Steven Wanderski 4 | * Written while drinking Belgian ales and listening to jazz 5 | * Licensed under MIT (http://opensource.org/licenses/MIT) 6 | */ 7 | 8 | ;(function($) { 9 | 10 | var defaults = { 11 | 12 | // GENERAL 13 | mode: 'horizontal', 14 | slideSelector: '', 15 | infiniteLoop: true, 16 | hideControlOnEnd: false, 17 | speed: 500, 18 | easing: null, 19 | slideMargin: 0, 20 | startSlide: 0, 21 | randomStart: false, 22 | captions: false, 23 | ticker: false, 24 | tickerHover: false, 25 | adaptiveHeight: false, 26 | adaptiveHeightSpeed: 500, 27 | video: false, 28 | useCSS: true, 29 | preloadImages: 'visible', 30 | responsive: true, 31 | slideZIndex: 50, 32 | wrapperClass: 'bx-wrapper', 33 | 34 | // TOUCH 35 | touchEnabled: true, 36 | swipeThreshold: 50, 37 | oneToOneTouch: true, 38 | preventDefaultSwipeX: true, 39 | preventDefaultSwipeY: false, 40 | 41 | // ACCESSIBILITY 42 | ariaLive: true, 43 | ariaHidden: true, 44 | 45 | // KEYBOARD 46 | keyboardEnabled: false, 47 | 48 | // PAGER 49 | pager: true, 50 | pagerType: 'full', 51 | pagerShortSeparator: ' / ', 52 | pagerSelector: null, 53 | buildPager: null, 54 | pagerCustom: null, 55 | 56 | // CONTROLS 57 | controls: true, 58 | nextText: 'Next', 59 | prevText: 'Prev', 60 | nextSelector: null, 61 | prevSelector: null, 62 | autoControls: false, 63 | startText: 'Start', 64 | stopText: 'Stop', 65 | autoControlsCombine: false, 66 | autoControlsSelector: null, 67 | 68 | // AUTO 69 | auto: false, 70 | pause: 4000, 71 | autoStart: true, 72 | autoDirection: 'next', 73 | stopAutoOnClick: false, 74 | autoHover: false, 75 | autoDelay: 0, 76 | autoSlideForOnePage: false, 77 | 78 | // CAROUSEL 79 | minSlides: 1, 80 | maxSlides: 1, 81 | moveSlides: 0, 82 | slideWidth: 0, 83 | shrinkItems: false, 84 | 85 | // CALLBACKS 86 | onSliderLoad: function() { return true; }, 87 | onSlideBefore: function() { return true; }, 88 | onSlideAfter: function() { return true; }, 89 | onSlideNext: function() { return true; }, 90 | onSlidePrev: function() { return true; }, 91 | onSliderResize: function() { return true; }, 92 | onAutoChange: function() { return true; } //calls when auto slides starts and stops 93 | }; 94 | 95 | $.fn.bxSlider = function(options) { 96 | 97 | if (this.length === 0) { 98 | return this; 99 | } 100 | 101 | // support multiple elements 102 | if (this.length > 1) { 103 | this.each(function() { 104 | $(this).bxSlider(options); 105 | }); 106 | return this; 107 | } 108 | 109 | // create a namespace to be used throughout the plugin 110 | var slider = {}, 111 | // set a reference to our slider element 112 | el = this, 113 | // get the original window dimens (thanks a lot IE) 114 | windowWidth = $(window).width(), 115 | windowHeight = $(window).height(); 116 | 117 | // Return if slider is already initialized 118 | if ($(el).data('bxSlider')) { return; } 119 | 120 | /** 121 | * =================================================================================== 122 | * = PRIVATE FUNCTIONS 123 | * =================================================================================== 124 | */ 125 | 126 | /** 127 | * Initializes namespace settings to be used throughout plugin 128 | */ 129 | var init = function() { 130 | // Return if slider is already initialized 131 | if ($(el).data('bxSlider')) { return; } 132 | // merge user-supplied options with the defaults 133 | slider.settings = $.extend({}, defaults, options); 134 | // parse slideWidth setting 135 | slider.settings.slideWidth = parseInt(slider.settings.slideWidth); 136 | // store the original children 137 | slider.children = el.children(slider.settings.slideSelector); 138 | // check if actual number of slides is less than minSlides / maxSlides 139 | if (slider.children.length < slider.settings.minSlides) { slider.settings.minSlides = slider.children.length; } 140 | if (slider.children.length < slider.settings.maxSlides) { slider.settings.maxSlides = slider.children.length; } 141 | // if random start, set the startSlide setting to random number 142 | if (slider.settings.randomStart) { slider.settings.startSlide = Math.floor(Math.random() * slider.children.length); } 143 | // store active slide information 144 | slider.active = { index: slider.settings.startSlide }; 145 | // store if the slider is in carousel mode (displaying / moving multiple slides) 146 | slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1; 147 | // if carousel, force preloadImages = 'all' 148 | if (slider.carousel) { slider.settings.preloadImages = 'all'; } 149 | // calculate the min / max width thresholds based on min / max number of slides 150 | // used to setup and update carousel slides dimensions 151 | slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin); 152 | slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); 153 | // store the current state of the slider (if currently animating, working is true) 154 | slider.working = false; 155 | // initialize the controls object 156 | slider.controls = {}; 157 | // initialize an auto interval 158 | slider.interval = null; 159 | // determine which property to use for transitions 160 | slider.animProp = slider.settings.mode === 'vertical' ? 'top' : 'left'; 161 | // determine if hardware acceleration can be used 162 | slider.usingCSS = slider.settings.useCSS && slider.settings.mode !== 'fade' && (function() { 163 | // create our test div element 164 | var div = document.createElement('div'), 165 | // css transition properties 166 | props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; 167 | // test for each property 168 | for (var i = 0; i < props.length; i++) { 169 | if (div.style[props[i]] !== undefined) { 170 | slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase(); 171 | slider.animProp = '-' + slider.cssPrefix + '-transform'; 172 | return true; 173 | } 174 | } 175 | return false; 176 | }()); 177 | // if vertical mode always make maxSlides and minSlides equal 178 | if (slider.settings.mode === 'vertical') { slider.settings.maxSlides = slider.settings.minSlides; } 179 | // save original style data 180 | el.data('origStyle', el.attr('style')); 181 | el.children(slider.settings.slideSelector).each(function() { 182 | $(this).data('origStyle', $(this).attr('style')); 183 | }); 184 | 185 | // perform all DOM / CSS modifications 186 | setup(); 187 | }; 188 | 189 | /** 190 | * Performs all DOM and CSS modifications 191 | */ 192 | var setup = function() { 193 | var preloadSelector = slider.children.eq(slider.settings.startSlide); // set the default preload selector (visible) 194 | 195 | // wrap el in a wrapper 196 | el.wrap('
      '); 197 | // store a namespace reference to .bx-viewport 198 | slider.viewport = el.parent(); 199 | 200 | // add aria-live if the setting is enabled and ticker mode is disabled 201 | if (slider.settings.ariaLive && !slider.settings.ticker) { 202 | slider.viewport.attr('aria-live', 'polite'); 203 | } 204 | // add a loading div to display while images are loading 205 | slider.loader = $('
      '); 206 | slider.viewport.prepend(slider.loader); 207 | // set el to a massive width, to hold any needed slides 208 | // also strip any margin and padding from el 209 | el.css({ 210 | width: slider.settings.mode === 'horizontal' ? (slider.children.length * 1000 + 215) + '%' : 'auto', 211 | position: 'relative' 212 | }); 213 | // if using CSS, add the easing property 214 | if (slider.usingCSS && slider.settings.easing) { 215 | el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing); 216 | // if not using CSS and no easing value was supplied, use the default JS animation easing (swing) 217 | } else if (!slider.settings.easing) { 218 | slider.settings.easing = 'swing'; 219 | } 220 | // make modifications to the viewport (.bx-viewport) 221 | slider.viewport.css({ 222 | width: '100%', 223 | overflow: 'hidden', 224 | position: 'relative' 225 | }); 226 | slider.viewport.parent().css({ 227 | maxWidth: getViewportMaxWidth() 228 | }); 229 | // apply css to all slider children 230 | slider.children.css({ 231 | // the float attribute is a reserved word in compressors like YUI compressor and need to be quoted #48 232 | 'float': slider.settings.mode === 'horizontal' ? 'left' : 'none', 233 | listStyle: 'none', 234 | position: 'relative' 235 | }); 236 | // apply the calculated width after the float is applied to prevent scrollbar interference 237 | slider.children.css('width', getSlideWidth()); 238 | // if slideMargin is supplied, add the css 239 | if (slider.settings.mode === 'horizontal' && slider.settings.slideMargin > 0) { slider.children.css('marginRight', slider.settings.slideMargin); } 240 | if (slider.settings.mode === 'vertical' && slider.settings.slideMargin > 0) { slider.children.css('marginBottom', slider.settings.slideMargin); } 241 | // if "fade" mode, add positioning and z-index CSS 242 | if (slider.settings.mode === 'fade') { 243 | slider.children.css({ 244 | position: 'absolute', 245 | zIndex: 0, 246 | display: 'none' 247 | }); 248 | // prepare the z-index on the showing element 249 | slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'}); 250 | } 251 | // create an element to contain all slider controls (pager, start / stop, etc) 252 | slider.controls.el = $('
      '); 253 | // if captions are requested, add them 254 | if (slider.settings.captions) { appendCaptions(); } 255 | // check if startSlide is last slide 256 | slider.active.last = slider.settings.startSlide === getPagerQty() - 1; 257 | // if video is true, set up the fitVids plugin 258 | if (slider.settings.video) { el.fitVids(); } 259 | //preloadImages 260 | if (slider.settings.preloadImages === 'none') { 261 | preloadSelector = null; 262 | } 263 | else if (slider.settings.preloadImages === 'all' || slider.settings.ticker) { 264 | preloadSelector = slider.children; 265 | } 266 | // only check for control addition if not in "ticker" mode 267 | if (!slider.settings.ticker) { 268 | // if controls are requested, add them 269 | if (slider.settings.controls) { appendControls(); } 270 | // if auto is true, and auto controls are requested, add them 271 | if (slider.settings.auto && slider.settings.autoControls) { appendControlsAuto(); } 272 | // if pager is requested, add it 273 | if (slider.settings.pager) { appendPager(); } 274 | // if any control option is requested, add the controls wrapper 275 | if (slider.settings.controls || slider.settings.autoControls || slider.settings.pager) { slider.viewport.after(slider.controls.el); } 276 | // if ticker mode, do not allow a pager 277 | } else { 278 | slider.settings.pager = false; 279 | } 280 | if (preloadSelector === null) { 281 | start(); 282 | } else { 283 | loadElements(preloadSelector, start); 284 | } 285 | }; 286 | 287 | var loadElements = function(selector, callback) { 288 | var total = selector.find('img:not([src=""]), iframe').length, 289 | count = 0; 290 | if (total === 0) { 291 | callback(); 292 | return; 293 | } 294 | selector.find('img:not([src=""]), iframe').each(function() { 295 | $(this).one('load error', function() { 296 | if (++count === total) { callback(); } 297 | }).each(function() { 298 | if (this.complete || this.src == '') { $(this).trigger('load'); } 299 | }); 300 | }); 301 | }; 302 | 303 | /** 304 | * Start the slider 305 | */ 306 | var start = function() { 307 | // if infinite loop, prepare additional slides 308 | if (slider.settings.infiniteLoop && slider.settings.mode !== 'fade' && !slider.settings.ticker) { 309 | var slice = slider.settings.mode === 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides, 310 | sliceAppend = slider.children.slice(0, slice).clone(true).addClass('bx-clone'), 311 | slicePrepend = slider.children.slice(-slice).clone(true).addClass('bx-clone'); 312 | if (slider.settings.ariaHidden) { 313 | sliceAppend.attr('aria-hidden', true); 314 | slicePrepend.attr('aria-hidden', true); 315 | } 316 | el.append(sliceAppend).prepend(slicePrepend); 317 | } 318 | // remove the loading DOM element 319 | slider.loader.remove(); 320 | // set the left / top position of "el" 321 | setSlidePosition(); 322 | // if "vertical" mode, always use adaptiveHeight to prevent odd behavior 323 | if (slider.settings.mode === 'vertical') { slider.settings.adaptiveHeight = true; } 324 | // set the viewport height 325 | slider.viewport.height(getViewportHeight()); 326 | // make sure everything is positioned just right (same as a window resize) 327 | el.redrawSlider(); 328 | // onSliderLoad callback 329 | slider.settings.onSliderLoad.call(el, slider.active.index); 330 | // slider has been fully initialized 331 | slider.initialized = true; 332 | // add the resize call to the window 333 | if (slider.settings.responsive) { $(window).on('resize', resizeWindow); } 334 | // if auto is true and has more than 1 page, start the show 335 | if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) { initAuto(); } 336 | // if ticker is true, start the ticker 337 | if (slider.settings.ticker) { initTicker(); } 338 | // if pager is requested, make the appropriate pager link active 339 | if (slider.settings.pager) { updatePagerActive(slider.settings.startSlide); } 340 | // check for any updates to the controls (like hideControlOnEnd updates) 341 | if (slider.settings.controls) { updateDirectionControls(); } 342 | // if touchEnabled is true, setup the touch events 343 | if (slider.settings.touchEnabled && !slider.settings.ticker) { initTouch(); } 344 | // if keyboardEnabled is true, setup the keyboard events 345 | if (slider.settings.keyboardEnabled && !slider.settings.ticker) { 346 | $(document).keydown(keyPress); 347 | } 348 | }; 349 | 350 | /** 351 | * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value 352 | */ 353 | var getViewportHeight = function() { 354 | var height = 0; 355 | // first determine which children (slides) should be used in our height calculation 356 | var children = $(); 357 | // if mode is not "vertical" and adaptiveHeight is false, include all children 358 | if (slider.settings.mode !== 'vertical' && !slider.settings.adaptiveHeight) { 359 | children = slider.children; 360 | } else { 361 | // if not carousel, return the single active child 362 | if (!slider.carousel) { 363 | children = slider.children.eq(slider.active.index); 364 | // if carousel, return a slice of children 365 | } else { 366 | // get the individual slide index 367 | var currentIndex = slider.settings.moveSlides === 1 ? slider.active.index : slider.active.index * getMoveBy(); 368 | // add the current slide to the children 369 | children = slider.children.eq(currentIndex); 370 | // cycle through the remaining "showing" slides 371 | for (i = 1; i <= slider.settings.maxSlides - 1; i++) { 372 | // if looped back to the start 373 | if (currentIndex + i >= slider.children.length) { 374 | children = children.add(slider.children.eq(i - 1)); 375 | } else { 376 | children = children.add(slider.children.eq(currentIndex + i)); 377 | } 378 | } 379 | } 380 | } 381 | // if "vertical" mode, calculate the sum of the heights of the children 382 | if (slider.settings.mode === 'vertical') { 383 | children.each(function(index) { 384 | height += $(this).outerHeight(); 385 | }); 386 | // add user-supplied margins 387 | if (slider.settings.slideMargin > 0) { 388 | height += slider.settings.slideMargin * (slider.settings.minSlides - 1); 389 | } 390 | // if not "vertical" mode, calculate the max height of the children 391 | } else { 392 | height = Math.max.apply(Math, children.map(function() { 393 | return $(this).outerHeight(false); 394 | }).get()); 395 | } 396 | 397 | if (slider.viewport.css('box-sizing') === 'border-box') { 398 | height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) + 399 | parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width')); 400 | } else if (slider.viewport.css('box-sizing') === 'padding-box') { 401 | height += parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')); 402 | } 403 | 404 | return height; 405 | }; 406 | 407 | /** 408 | * Returns the calculated width to be used for the outer wrapper / viewport 409 | */ 410 | var getViewportMaxWidth = function() { 411 | var width = '100%'; 412 | if (slider.settings.slideWidth > 0) { 413 | if (slider.settings.mode === 'horizontal') { 414 | width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); 415 | } else { 416 | width = slider.settings.slideWidth; 417 | } 418 | } 419 | return width; 420 | }; 421 | 422 | /** 423 | * Returns the calculated width to be applied to each slide 424 | */ 425 | var getSlideWidth = function() { 426 | var newElWidth = slider.settings.slideWidth, // start with any user-supplied slide width 427 | wrapWidth = slider.viewport.width(); // get the current viewport width 428 | // if slide width was not supplied, or is larger than the viewport use the viewport width 429 | if (slider.settings.slideWidth === 0 || 430 | (slider.settings.slideWidth > wrapWidth && !slider.carousel) || 431 | slider.settings.mode === 'vertical') { 432 | newElWidth = wrapWidth; 433 | // if carousel, use the thresholds to determine the width 434 | } else if (slider.settings.maxSlides > 1 && slider.settings.mode === 'horizontal') { 435 | if (wrapWidth > slider.maxThreshold) { 436 | return newElWidth; 437 | } else if (wrapWidth < slider.minThreshold) { 438 | newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides; 439 | } else if (slider.settings.shrinkItems) { 440 | newElWidth = Math.floor((wrapWidth + slider.settings.slideMargin) / (Math.ceil((wrapWidth + slider.settings.slideMargin) / (newElWidth + slider.settings.slideMargin))) - slider.settings.slideMargin); 441 | } 442 | } 443 | return newElWidth; 444 | }; 445 | 446 | /** 447 | * Returns the number of slides currently visible in the viewport (includes partially visible slides) 448 | */ 449 | var getNumberSlidesShowing = function() { 450 | var slidesShowing = 1, 451 | childWidth = null; 452 | if (slider.settings.mode === 'horizontal' && slider.settings.slideWidth > 0) { 453 | // if viewport is smaller than minThreshold, return minSlides 454 | if (slider.viewport.width() < slider.minThreshold) { 455 | slidesShowing = slider.settings.minSlides; 456 | // if viewport is larger than maxThreshold, return maxSlides 457 | } else if (slider.viewport.width() > slider.maxThreshold) { 458 | slidesShowing = slider.settings.maxSlides; 459 | // if viewport is between min / max thresholds, divide viewport width by first child width 460 | } else { 461 | childWidth = slider.children.first().width() + slider.settings.slideMargin; 462 | slidesShowing = Math.floor((slider.viewport.width() + 463 | slider.settings.slideMargin) / childWidth) || 1; 464 | } 465 | // if "vertical" mode, slides showing will always be minSlides 466 | } else if (slider.settings.mode === 'vertical') { 467 | slidesShowing = slider.settings.minSlides; 468 | } 469 | return slidesShowing; 470 | }; 471 | 472 | /** 473 | * Returns the number of pages (one full viewport of slides is one "page") 474 | */ 475 | var getPagerQty = function() { 476 | var pagerQty = 0, 477 | breakPoint = 0, 478 | counter = 0; 479 | // if moveSlides is specified by the user 480 | if (slider.settings.moveSlides > 0) { 481 | if (slider.settings.infiniteLoop) { 482 | pagerQty = Math.ceil(slider.children.length / getMoveBy()); 483 | } else { 484 | // when breakpoint goes above children length, counter is the number of pages 485 | while (breakPoint < slider.children.length) { 486 | ++pagerQty; 487 | breakPoint = counter + getNumberSlidesShowing(); 488 | counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing(); 489 | } 490 | return counter; 491 | } 492 | // if moveSlides is 0 (auto) divide children length by sides showing, then round up 493 | } else { 494 | pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing()); 495 | } 496 | return pagerQty; 497 | }; 498 | 499 | /** 500 | * Returns the number of individual slides by which to shift the slider 501 | */ 502 | var getMoveBy = function() { 503 | // if moveSlides was set by the user and moveSlides is less than number of slides showing 504 | if (slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()) { 505 | return slider.settings.moveSlides; 506 | } 507 | // if moveSlides is 0 (auto) 508 | return getNumberSlidesShowing(); 509 | }; 510 | 511 | /** 512 | * Sets the slider's (el) left or top position 513 | */ 514 | var setSlidePosition = function() { 515 | var position, lastChild, lastShowingIndex; 516 | // if last slide, not infinite loop, and number of children is larger than specified maxSlides 517 | if (slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop) { 518 | if (slider.settings.mode === 'horizontal') { 519 | // get the last child's position 520 | lastChild = slider.children.last(); 521 | position = lastChild.position(); 522 | // set the left position 523 | setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0); 524 | } else if (slider.settings.mode === 'vertical') { 525 | // get the last showing index's position 526 | lastShowingIndex = slider.children.length - slider.settings.minSlides; 527 | position = slider.children.eq(lastShowingIndex).position(); 528 | // set the top position 529 | setPositionProperty(-position.top, 'reset', 0); 530 | } 531 | // if not last slide 532 | } else { 533 | // get the position of the first showing slide 534 | position = slider.children.eq(slider.active.index * getMoveBy()).position(); 535 | // check for last slide 536 | if (slider.active.index === getPagerQty() - 1) { slider.active.last = true; } 537 | // set the respective position 538 | if (position !== undefined) { 539 | if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); } 540 | else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); } 541 | } 542 | } 543 | }; 544 | 545 | /** 546 | * Sets the el's animating property position (which in turn will sometimes animate el). 547 | * If using CSS, sets the transform property. If not using CSS, sets the top / left property. 548 | * 549 | * @param value (int) 550 | * - the animating property's value 551 | * 552 | * @param type (string) 'slide', 'reset', 'ticker' 553 | * - the type of instance for which the function is being 554 | * 555 | * @param duration (int) 556 | * - the amount of time (in ms) the transition should occupy 557 | * 558 | * @param params (array) optional 559 | * - an optional parameter containing any variables that need to be passed in 560 | */ 561 | var setPositionProperty = function(value, type, duration, params) { 562 | var animateObj, propValue; 563 | // use CSS transform 564 | if (slider.usingCSS) { 565 | // determine the translate3d value 566 | propValue = slider.settings.mode === 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)'; 567 | // add the CSS transition-duration 568 | el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's'); 569 | if (type === 'slide') { 570 | // set the property value 571 | el.css(slider.animProp, propValue); 572 | if (duration !== 0) { 573 | // add a callback method - executes when CSS transition completes 574 | el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { 575 | //make sure it's the correct one 576 | if (!$(e.target).is(el)) { return; } 577 | // remove the callback 578 | el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); 579 | updateAfterSlideTransition(); 580 | }); 581 | } else { //duration = 0 582 | updateAfterSlideTransition(); 583 | } 584 | } else if (type === 'reset') { 585 | el.css(slider.animProp, propValue); 586 | } else if (type === 'ticker') { 587 | // make the transition use 'linear' 588 | el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear'); 589 | el.css(slider.animProp, propValue); 590 | if (duration !== 0) { 591 | el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(e) { 592 | //make sure it's the correct one 593 | if (!$(e.target).is(el)) { return; } 594 | // remove the callback 595 | el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); 596 | // reset the position 597 | setPositionProperty(params.resetValue, 'reset', 0); 598 | // start the loop again 599 | tickerLoop(); 600 | }); 601 | } else { //duration = 0 602 | setPositionProperty(params.resetValue, 'reset', 0); 603 | tickerLoop(); 604 | } 605 | } 606 | // use JS animate 607 | } else { 608 | animateObj = {}; 609 | animateObj[slider.animProp] = value; 610 | if (type === 'slide') { 611 | el.animate(animateObj, duration, slider.settings.easing, function() { 612 | updateAfterSlideTransition(); 613 | }); 614 | } else if (type === 'reset') { 615 | el.css(slider.animProp, value); 616 | } else if (type === 'ticker') { 617 | el.animate(animateObj, duration, 'linear', function() { 618 | setPositionProperty(params.resetValue, 'reset', 0); 619 | // run the recursive loop after animation 620 | tickerLoop(); 621 | }); 622 | } 623 | } 624 | }; 625 | 626 | /** 627 | * Populates the pager with proper amount of pages 628 | */ 629 | var populatePager = function() { 630 | var pagerHtml = '', 631 | linkContent = '', 632 | pagerQty = getPagerQty(); 633 | // loop through each pager item 634 | for (var i = 0; i < pagerQty; i++) { 635 | linkContent = ''; 636 | // if a buildPager function is supplied, use it to get pager link value, else use index + 1 637 | if (slider.settings.buildPager && $.isFunction(slider.settings.buildPager) || slider.settings.pagerCustom) { 638 | linkContent = slider.settings.buildPager(i); 639 | slider.pagerEl.addClass('bx-custom-pager'); 640 | } else { 641 | linkContent = i + 1; 642 | slider.pagerEl.addClass('bx-default-pager'); 643 | } 644 | // var linkContent = slider.settings.buildPager && $.isFunction(slider.settings.buildPager) ? slider.settings.buildPager(i) : i + 1; 645 | // add the markup to the string 646 | pagerHtml += ''; 647 | } 648 | // populate the pager element with pager links 649 | slider.pagerEl.html(pagerHtml); 650 | }; 651 | 652 | /** 653 | * Appends the pager to the controls element 654 | */ 655 | var appendPager = function() { 656 | if (!slider.settings.pagerCustom) { 657 | // create the pager DOM element 658 | slider.pagerEl = $('
      '); 659 | // if a pager selector was supplied, populate it with the pager 660 | if (slider.settings.pagerSelector) { 661 | $(slider.settings.pagerSelector).html(slider.pagerEl); 662 | // if no pager selector was supplied, add it after the wrapper 663 | } else { 664 | slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl); 665 | } 666 | // populate the pager 667 | populatePager(); 668 | } else { 669 | slider.pagerEl = $(slider.settings.pagerCustom); 670 | } 671 | // assign the pager click binding 672 | slider.pagerEl.on('click touchend', 'a', clickPagerBind); 673 | }; 674 | 675 | /** 676 | * Appends prev / next controls to the controls element 677 | */ 678 | var appendControls = function() { 679 | slider.controls.next = $('' + slider.settings.nextText + ''); 680 | slider.controls.prev = $('' + slider.settings.prevText + ''); 681 | // add click actions to the controls 682 | slider.controls.next.on('click touchend', clickNextBind); 683 | slider.controls.prev.on('click touchend', clickPrevBind); 684 | // if nextSelector was supplied, populate it 685 | if (slider.settings.nextSelector) { 686 | $(slider.settings.nextSelector).append(slider.controls.next); 687 | } 688 | // if prevSelector was supplied, populate it 689 | if (slider.settings.prevSelector) { 690 | $(slider.settings.prevSelector).append(slider.controls.prev); 691 | } 692 | // if no custom selectors were supplied 693 | if (!slider.settings.nextSelector && !slider.settings.prevSelector) { 694 | // add the controls to the DOM 695 | slider.controls.directionEl = $('
      '); 696 | // add the control elements to the directionEl 697 | slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next); 698 | // slider.viewport.append(slider.controls.directionEl); 699 | slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl); 700 | } 701 | }; 702 | 703 | /** 704 | * Appends start / stop auto controls to the controls element 705 | */ 706 | var appendControlsAuto = function() { 707 | slider.controls.start = $(''); 708 | slider.controls.stop = $(''); 709 | // add the controls to the DOM 710 | slider.controls.autoEl = $('
      '); 711 | // on click actions to the controls 712 | slider.controls.autoEl.on('click', '.bx-start', clickStartBind); 713 | slider.controls.autoEl.on('click', '.bx-stop', clickStopBind); 714 | // if autoControlsCombine, insert only the "start" control 715 | if (slider.settings.autoControlsCombine) { 716 | slider.controls.autoEl.append(slider.controls.start); 717 | // if autoControlsCombine is false, insert both controls 718 | } else { 719 | slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop); 720 | } 721 | // if auto controls selector was supplied, populate it with the controls 722 | if (slider.settings.autoControlsSelector) { 723 | $(slider.settings.autoControlsSelector).html(slider.controls.autoEl); 724 | // if auto controls selector was not supplied, add it after the wrapper 725 | } else { 726 | slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl); 727 | } 728 | // update the auto controls 729 | updateAutoControls(slider.settings.autoStart ? 'stop' : 'start'); 730 | }; 731 | 732 | /** 733 | * Appends image captions to the DOM 734 | */ 735 | var appendCaptions = function() { 736 | // cycle through each child 737 | slider.children.each(function(index) { 738 | // get the image title attribute 739 | var title = $(this).find('img:first').attr('title'); 740 | // append the caption 741 | if (title !== undefined && ('' + title).length) { 742 | $(this).append('
      ' + title + '
      '); 743 | } 744 | }); 745 | }; 746 | 747 | /** 748 | * Click next binding 749 | * 750 | * @param e (event) 751 | * - DOM event object 752 | */ 753 | var clickNextBind = function(e) { 754 | e.preventDefault(); 755 | if (slider.controls.el.hasClass('disabled')) { return; } 756 | // if auto show is running, stop it 757 | if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 758 | el.goToNextSlide(); 759 | }; 760 | 761 | /** 762 | * Click prev binding 763 | * 764 | * @param e (event) 765 | * - DOM event object 766 | */ 767 | var clickPrevBind = function(e) { 768 | e.preventDefault(); 769 | if (slider.controls.el.hasClass('disabled')) { return; } 770 | // if auto show is running, stop it 771 | if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 772 | el.goToPrevSlide(); 773 | }; 774 | 775 | /** 776 | * Click start binding 777 | * 778 | * @param e (event) 779 | * - DOM event object 780 | */ 781 | var clickStartBind = function(e) { 782 | el.startAuto(); 783 | e.preventDefault(); 784 | }; 785 | 786 | /** 787 | * Click stop binding 788 | * 789 | * @param e (event) 790 | * - DOM event object 791 | */ 792 | var clickStopBind = function(e) { 793 | el.stopAuto(); 794 | e.preventDefault(); 795 | }; 796 | 797 | /** 798 | * Click pager binding 799 | * 800 | * @param e (event) 801 | * - DOM event object 802 | */ 803 | var clickPagerBind = function(e) { 804 | var pagerLink, pagerIndex; 805 | e.preventDefault(); 806 | if (slider.controls.el.hasClass('disabled')) { 807 | return; 808 | } 809 | // if auto show is running, stop it 810 | if (slider.settings.auto && slider.settings.stopAutoOnClick) { el.stopAuto(); } 811 | pagerLink = $(e.currentTarget); 812 | if (pagerLink.attr('data-slide-index') !== undefined) { 813 | pagerIndex = parseInt(pagerLink.attr('data-slide-index')); 814 | // if clicked pager link is not active, continue with the goToSlide call 815 | if (pagerIndex !== slider.active.index) { el.goToSlide(pagerIndex); } 816 | } 817 | }; 818 | 819 | /** 820 | * Updates the pager links with an active class 821 | * 822 | * @param slideIndex (int) 823 | * - index of slide to make active 824 | */ 825 | var updatePagerActive = function(slideIndex) { 826 | // if "short" pager type 827 | var len = slider.children.length; // nb of children 828 | if (slider.settings.pagerType === 'short') { 829 | if (slider.settings.maxSlides > 1) { 830 | len = Math.ceil(slider.children.length / slider.settings.maxSlides); 831 | } 832 | slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len); 833 | return; 834 | } 835 | // remove all pager active classes 836 | slider.pagerEl.find('a').removeClass('active'); 837 | // apply the active class for all pagers 838 | slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); }); 839 | }; 840 | 841 | /** 842 | * Performs needed actions after a slide transition 843 | */ 844 | var updateAfterSlideTransition = function() { 845 | // if infinite loop is true 846 | if (slider.settings.infiniteLoop) { 847 | var position = ''; 848 | // first slide 849 | if (slider.active.index === 0) { 850 | // set the new position 851 | position = slider.children.eq(0).position(); 852 | // carousel, last slide 853 | } else if (slider.active.index === getPagerQty() - 1 && slider.carousel) { 854 | position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position(); 855 | // last slide 856 | } else if (slider.active.index === slider.children.length - 1) { 857 | position = slider.children.eq(slider.children.length - 1).position(); 858 | } 859 | if (position) { 860 | if (slider.settings.mode === 'horizontal') { setPositionProperty(-position.left, 'reset', 0); } 861 | else if (slider.settings.mode === 'vertical') { setPositionProperty(-position.top, 'reset', 0); } 862 | } 863 | } 864 | // declare that the transition is complete 865 | slider.working = false; 866 | // onSlideAfter callback 867 | slider.settings.onSlideAfter.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); 868 | }; 869 | 870 | /** 871 | * Updates the auto controls state (either active, or combined switch) 872 | * 873 | * @param state (string) "start", "stop" 874 | * - the new state of the auto show 875 | */ 876 | var updateAutoControls = function(state) { 877 | // if autoControlsCombine is true, replace the current control with the new state 878 | if (slider.settings.autoControlsCombine) { 879 | slider.controls.autoEl.html(slider.controls[state]); 880 | // if autoControlsCombine is false, apply the "active" class to the appropriate control 881 | } else { 882 | slider.controls.autoEl.find('a').removeClass('active'); 883 | slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active'); 884 | } 885 | }; 886 | 887 | /** 888 | * Updates the direction controls (checks if either should be hidden) 889 | */ 890 | var updateDirectionControls = function() { 891 | if (getPagerQty() === 1) { 892 | slider.controls.prev.addClass('disabled'); 893 | slider.controls.next.addClass('disabled'); 894 | } else if (!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd) { 895 | // if first slide 896 | if (slider.active.index === 0) { 897 | slider.controls.prev.addClass('disabled'); 898 | slider.controls.next.removeClass('disabled'); 899 | // if last slide 900 | } else if (slider.active.index === getPagerQty() - 1) { 901 | slider.controls.next.addClass('disabled'); 902 | slider.controls.prev.removeClass('disabled'); 903 | // if any slide in the middle 904 | } else { 905 | slider.controls.prev.removeClass('disabled'); 906 | slider.controls.next.removeClass('disabled'); 907 | } 908 | } 909 | }; 910 | /* auto start and stop functions */ 911 | var windowFocusHandler = function() { el.startAuto(); }; 912 | var windowBlurHandler = function() { el.stopAuto(); }; 913 | /** 914 | * Initializes the auto process 915 | */ 916 | var initAuto = function() { 917 | // if autoDelay was supplied, launch the auto show using a setTimeout() call 918 | if (slider.settings.autoDelay > 0) { 919 | setTimeout(el.startAuto, slider.settings.autoDelay); 920 | // if autoDelay was not supplied, start the auto show normally 921 | } else { 922 | el.startAuto(); 923 | 924 | //add focus and blur events to ensure its running if timeout gets paused 925 | $(window).focus(windowFocusHandler).blur(windowBlurHandler); 926 | } 927 | // if autoHover is requested 928 | if (slider.settings.autoHover) { 929 | // on el hover 930 | el.hover(function() { 931 | // if the auto show is currently playing (has an active interval) 932 | if (slider.interval) { 933 | // stop the auto show and pass true argument which will prevent control update 934 | el.stopAuto(true); 935 | // create a new autoPaused value which will be used by the relative "mouseout" event 936 | slider.autoPaused = true; 937 | } 938 | }, function() { 939 | // if the autoPaused value was created be the prior "mouseover" event 940 | if (slider.autoPaused) { 941 | // start the auto show and pass true argument which will prevent control update 942 | el.startAuto(true); 943 | // reset the autoPaused value 944 | slider.autoPaused = null; 945 | } 946 | }); 947 | } 948 | }; 949 | 950 | /** 951 | * Initializes the ticker process 952 | */ 953 | var initTicker = function() { 954 | var startPosition = 0, 955 | position, transform, value, idx, ratio, property, newSpeed, totalDimens; 956 | // if autoDirection is "next", append a clone of the entire slider 957 | if (slider.settings.autoDirection === 'next') { 958 | el.append(slider.children.clone().addClass('bx-clone')); 959 | // if autoDirection is "prev", prepend a clone of the entire slider, and set the left position 960 | } else { 961 | el.prepend(slider.children.clone().addClass('bx-clone')); 962 | position = slider.children.first().position(); 963 | startPosition = slider.settings.mode === 'horizontal' ? -position.left : -position.top; 964 | } 965 | setPositionProperty(startPosition, 'reset', 0); 966 | // do not allow controls in ticker mode 967 | slider.settings.pager = false; 968 | slider.settings.controls = false; 969 | slider.settings.autoControls = false; 970 | // if autoHover is requested 971 | if (slider.settings.tickerHover) { 972 | if (slider.usingCSS) { 973 | idx = slider.settings.mode === 'horizontal' ? 4 : 5; 974 | slider.viewport.hover(function() { 975 | transform = el.css('-' + slider.cssPrefix + '-transform'); 976 | value = parseFloat(transform.split(',')[idx]); 977 | setPositionProperty(value, 'reset', 0); 978 | }, function() { 979 | totalDimens = 0; 980 | slider.children.each(function(index) { 981 | totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true); 982 | }); 983 | // calculate the speed ratio (used to determine the new speed to finish the paused animation) 984 | ratio = slider.settings.speed / totalDimens; 985 | // determine which property to use 986 | property = slider.settings.mode === 'horizontal' ? 'left' : 'top'; 987 | // calculate the new speed 988 | newSpeed = ratio * (totalDimens - (Math.abs(parseInt(value)))); 989 | tickerLoop(newSpeed); 990 | }); 991 | } else { 992 | // on el hover 993 | slider.viewport.hover(function() { 994 | el.stop(); 995 | }, function() { 996 | // calculate the total width of children (used to calculate the speed ratio) 997 | totalDimens = 0; 998 | slider.children.each(function(index) { 999 | totalDimens += slider.settings.mode === 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true); 1000 | }); 1001 | // calculate the speed ratio (used to determine the new speed to finish the paused animation) 1002 | ratio = slider.settings.speed / totalDimens; 1003 | // determine which property to use 1004 | property = slider.settings.mode === 'horizontal' ? 'left' : 'top'; 1005 | // calculate the new speed 1006 | newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property))))); 1007 | tickerLoop(newSpeed); 1008 | }); 1009 | } 1010 | } 1011 | // start the ticker loop 1012 | tickerLoop(); 1013 | }; 1014 | 1015 | /** 1016 | * Runs a continuous loop, news ticker-style 1017 | */ 1018 | var tickerLoop = function(resumeSpeed) { 1019 | var speed = resumeSpeed ? resumeSpeed : slider.settings.speed, 1020 | position = {left: 0, top: 0}, 1021 | reset = {left: 0, top: 0}, 1022 | animateProperty, resetValue, params; 1023 | 1024 | // if "next" animate left position to last child, then reset left to 0 1025 | if (slider.settings.autoDirection === 'next') { 1026 | position = el.find('.bx-clone').first().position(); 1027 | // if "prev" animate left position to 0, then reset left to first non-clone child 1028 | } else { 1029 | reset = slider.children.first().position(); 1030 | } 1031 | animateProperty = slider.settings.mode === 'horizontal' ? -position.left : -position.top; 1032 | resetValue = slider.settings.mode === 'horizontal' ? -reset.left : -reset.top; 1033 | params = {resetValue: resetValue}; 1034 | setPositionProperty(animateProperty, 'ticker', speed, params); 1035 | }; 1036 | 1037 | /** 1038 | * Check if el is on screen 1039 | */ 1040 | var isOnScreen = function(el) { 1041 | var win = $(window), 1042 | viewport = { 1043 | top: win.scrollTop(), 1044 | left: win.scrollLeft() 1045 | }, 1046 | bounds = el.offset(); 1047 | 1048 | viewport.right = viewport.left + win.width(); 1049 | viewport.bottom = viewport.top + win.height(); 1050 | bounds.right = bounds.left + el.outerWidth(); 1051 | bounds.bottom = bounds.top + el.outerHeight(); 1052 | 1053 | return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 1054 | }; 1055 | 1056 | /** 1057 | * Initializes keyboard events 1058 | */ 1059 | var keyPress = function(e) { 1060 | var activeElementTag = document.activeElement.tagName.toLowerCase(), 1061 | tagFilters = 'input|textarea', 1062 | p = new RegExp(activeElementTag,['i']), 1063 | result = p.exec(tagFilters); 1064 | 1065 | if (result == null && isOnScreen(el)) { 1066 | if (e.keyCode === 39) { 1067 | clickNextBind(e); 1068 | return false; 1069 | } else if (e.keyCode === 37) { 1070 | clickPrevBind(e); 1071 | return false; 1072 | } 1073 | } 1074 | }; 1075 | 1076 | /** 1077 | * Initializes touch events 1078 | */ 1079 | var initTouch = function() { 1080 | // initialize object to contain all touch values 1081 | slider.touch = { 1082 | start: {x: 0, y: 0}, 1083 | end: {x: 0, y: 0} 1084 | }; 1085 | slider.viewport.on('touchstart MSPointerDown pointerdown', onTouchStart); 1086 | 1087 | //for browsers that have implemented pointer events and fire a click after 1088 | //every pointerup regardless of whether pointerup is on same screen location as pointerdown or not 1089 | slider.viewport.on('click', '.bxslider a', function(e) { 1090 | if (slider.viewport.hasClass('click-disabled')) { 1091 | e.preventDefault(); 1092 | slider.viewport.removeClass('click-disabled'); 1093 | } 1094 | }); 1095 | }; 1096 | 1097 | /** 1098 | * Event handler for "touchstart" 1099 | * 1100 | * @param e (event) 1101 | * - DOM event object 1102 | */ 1103 | var onTouchStart = function(e) { 1104 | // if the target is a link allow it to click through and 1105 | // follow the URL 1106 | if ($(e.target).is('a')) { 1107 | return; 1108 | } 1109 | 1110 | // watch only for left mouse, touch contact and pen contact 1111 | // touchstart event object doesn`t have button property 1112 | if (e.type !== 'touchstart' && e.button !== 0) { 1113 | return; 1114 | } 1115 | e.preventDefault(); 1116 | //disable slider controls while user is interacting with slides to avoid slider freeze that happens on touch devices when a slide swipe happens immediately after interacting with slider controls 1117 | slider.controls.el.addClass('disabled'); 1118 | 1119 | if (slider.working) { 1120 | slider.controls.el.removeClass('disabled'); 1121 | } else { 1122 | // record the original position when touch starts 1123 | slider.touch.originalPos = el.position(); 1124 | var orig = e.originalEvent, 1125 | touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig]; 1126 | var chromePointerEvents = typeof PointerEvent === 'function'; 1127 | if (chromePointerEvents) { 1128 | if (orig.pointerId === undefined) { 1129 | return; 1130 | } 1131 | } 1132 | // record the starting touch x, y coordinates 1133 | slider.touch.start.x = touchPoints[0].pageX; 1134 | slider.touch.start.y = touchPoints[0].pageY; 1135 | 1136 | if (slider.viewport.get(0).setPointerCapture) { 1137 | slider.pointerId = orig.pointerId; 1138 | slider.viewport.get(0).setPointerCapture(slider.pointerId); 1139 | } 1140 | // store original event data for click fixation 1141 | slider.originalClickTarget = orig.originalTarget || orig.target; 1142 | slider.originalClickButton = orig.button; 1143 | slider.originalClickButtons = orig.buttons; 1144 | slider.originalEventType = orig.type; 1145 | // at this moment we don`t know what it is click or swipe 1146 | slider.hasMove = false; 1147 | // on a "touchmove" event to the viewport 1148 | slider.viewport.on('touchmove MSPointerMove pointermove', onTouchMove); 1149 | // on a "touchend" event to the viewport 1150 | slider.viewport.on('touchend MSPointerUp pointerup', onTouchEnd); 1151 | slider.viewport.on('MSPointerCancel pointercancel', onPointerCancel); 1152 | } 1153 | }; 1154 | 1155 | /** 1156 | * Cancel Pointer for Windows Phone 1157 | * 1158 | * @param e (event) 1159 | * - DOM event object 1160 | */ 1161 | var onPointerCancel = function(e) { 1162 | e.preventDefault(); 1163 | /* onPointerCancel handler is needed to deal with situations when a touchend 1164 | doesn't fire after a touchstart (this happens on windows phones only) */ 1165 | setPositionProperty(slider.touch.originalPos.left, 'reset', 0); 1166 | 1167 | //remove handlers 1168 | slider.controls.el.removeClass('disabled'); 1169 | slider.viewport.off('MSPointerCancel pointercancel', onPointerCancel); 1170 | slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove); 1171 | slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd); 1172 | if (slider.viewport.get(0).releasePointerCapture) { 1173 | slider.viewport.get(0).releasePointerCapture(slider.pointerId); 1174 | } 1175 | }; 1176 | 1177 | /** 1178 | * Event handler for "touchmove" 1179 | * 1180 | * @param e (event) 1181 | * - DOM event object 1182 | */ 1183 | var onTouchMove = function(e) { 1184 | var orig = e.originalEvent, 1185 | touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], 1186 | // if scrolling on y axis, do not prevent default 1187 | xMovement = Math.abs(touchPoints[0].pageX - slider.touch.start.x), 1188 | yMovement = Math.abs(touchPoints[0].pageY - slider.touch.start.y), 1189 | value = 0, 1190 | change = 0; 1191 | // this is swipe 1192 | slider.hasMove = true; 1193 | 1194 | // x axis swipe 1195 | if ((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX) { 1196 | e.preventDefault(); 1197 | // y axis swipe 1198 | } else if ((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY) { 1199 | e.preventDefault(); 1200 | } 1201 | if (e.type !== 'touchmove') { 1202 | e.preventDefault(); 1203 | } 1204 | 1205 | if (slider.settings.mode !== 'fade' && slider.settings.oneToOneTouch) { 1206 | // if horizontal, drag along x axis 1207 | if (slider.settings.mode === 'horizontal') { 1208 | change = touchPoints[0].pageX - slider.touch.start.x; 1209 | value = slider.touch.originalPos.left + change; 1210 | // if vertical, drag along y axis 1211 | } else { 1212 | change = touchPoints[0].pageY - slider.touch.start.y; 1213 | value = slider.touch.originalPos.top + change; 1214 | } 1215 | setPositionProperty(value, 'reset', 0); 1216 | } 1217 | }; 1218 | 1219 | /** 1220 | * Event handler for "touchend" 1221 | * 1222 | * @param e (event) 1223 | * - DOM event object 1224 | */ 1225 | var onTouchEnd = function(e) { 1226 | e.preventDefault(); 1227 | slider.viewport.off('touchmove MSPointerMove pointermove', onTouchMove); 1228 | //enable slider controls as soon as user stops interacing with slides 1229 | slider.controls.el.removeClass('disabled'); 1230 | var orig = e.originalEvent, 1231 | touchPoints = (typeof orig.changedTouches !== 'undefined') ? orig.changedTouches : [orig], 1232 | value = 0, 1233 | distance = 0; 1234 | // record end x, y positions 1235 | slider.touch.end.x = touchPoints[0].pageX; 1236 | slider.touch.end.y = touchPoints[0].pageY; 1237 | // if fade mode, check if absolute x distance clears the threshold 1238 | if (slider.settings.mode === 'fade') { 1239 | distance = Math.abs(slider.touch.start.x - slider.touch.end.x); 1240 | if (distance >= slider.settings.swipeThreshold) { 1241 | if (slider.touch.start.x > slider.touch.end.x) { 1242 | el.goToNextSlide(); 1243 | } else { 1244 | el.goToPrevSlide(); 1245 | } 1246 | el.stopAuto(); 1247 | } 1248 | // not fade mode 1249 | } else { 1250 | // calculate distance and el's animate property 1251 | if (slider.settings.mode === 'horizontal') { 1252 | distance = slider.touch.end.x - slider.touch.start.x; 1253 | value = slider.touch.originalPos.left; 1254 | } else { 1255 | distance = slider.touch.end.y - slider.touch.start.y; 1256 | value = slider.touch.originalPos.top; 1257 | } 1258 | // if not infinite loop and first / last slide, do not attempt a slide transition 1259 | if (!slider.settings.infiniteLoop && ((slider.active.index === 0 && distance > 0) || (slider.active.last && distance < 0))) { 1260 | setPositionProperty(value, 'reset', 200); 1261 | } else { 1262 | // check if distance clears threshold 1263 | if (Math.abs(distance) >= slider.settings.swipeThreshold) { 1264 | if (distance < 0) { 1265 | el.goToNextSlide(); 1266 | } else { 1267 | el.goToPrevSlide(); 1268 | } 1269 | el.stopAuto(); 1270 | } else { 1271 | // el.animate(property, 200); 1272 | setPositionProperty(value, 'reset', 200); 1273 | } 1274 | } 1275 | } 1276 | slider.viewport.off('touchend MSPointerUp pointerup', onTouchEnd); 1277 | 1278 | if (slider.viewport.get(0).releasePointerCapture) { 1279 | slider.viewport.get(0).releasePointerCapture(slider.pointerId); 1280 | } 1281 | // if slider had swipe with left mouse, touch contact and pen contact 1282 | if (slider.hasMove === false && (slider.originalClickButton === 0 || slider.originalEventType === 'touchstart')) { 1283 | // trigger click event (fix for Firefox59 and PointerEvent standard compatibility) 1284 | $(slider.originalClickTarget).trigger({ 1285 | type: 'click', 1286 | button: slider.originalClickButton, 1287 | buttons: slider.originalClickButtons 1288 | }); 1289 | } 1290 | }; 1291 | 1292 | /** 1293 | * Window resize event callback 1294 | */ 1295 | var resizeWindow = function(e) { 1296 | // don't do anything if slider isn't initialized. 1297 | if (!slider.initialized) { return; } 1298 | // Delay if slider working. 1299 | if (slider.working) { 1300 | window.setTimeout(resizeWindow, 10); 1301 | } else { 1302 | // get the new window dimens (again, thank you IE) 1303 | var windowWidthNew = $(window).width(), 1304 | windowHeightNew = $(window).height(); 1305 | // make sure that it is a true window resize 1306 | // *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements 1307 | // are resized. Can you just die already?* 1308 | if (windowWidth !== windowWidthNew || windowHeight !== windowHeightNew) { 1309 | // set the new window dimens 1310 | windowWidth = windowWidthNew; 1311 | windowHeight = windowHeightNew; 1312 | // update all dynamic elements 1313 | el.redrawSlider(); 1314 | // Call user resize handler 1315 | slider.settings.onSliderResize.call(el, slider.active.index); 1316 | } 1317 | } 1318 | }; 1319 | 1320 | /** 1321 | * Adds an aria-hidden=true attribute to each element 1322 | * 1323 | * @param startVisibleIndex (int) 1324 | * - the first visible element's index 1325 | */ 1326 | var applyAriaHiddenAttributes = function(startVisibleIndex) { 1327 | var numberOfSlidesShowing = getNumberSlidesShowing(); 1328 | // only apply attributes if the setting is enabled and not in ticker mode 1329 | if (slider.settings.ariaHidden && !slider.settings.ticker) { 1330 | // add aria-hidden=true to all elements 1331 | slider.children.attr('aria-hidden', 'true'); 1332 | // get the visible elements and change to aria-hidden=false 1333 | slider.children.slice(startVisibleIndex, startVisibleIndex + numberOfSlidesShowing).attr('aria-hidden', 'false'); 1334 | } 1335 | }; 1336 | 1337 | /** 1338 | * Returns index according to present page range 1339 | * 1340 | * @param slideOndex (int) 1341 | * - the desired slide index 1342 | */ 1343 | var setSlideIndex = function(slideIndex) { 1344 | if (slideIndex < 0) { 1345 | if (slider.settings.infiniteLoop) { 1346 | return getPagerQty() - 1; 1347 | }else { 1348 | //we don't go to undefined slides 1349 | return slider.active.index; 1350 | } 1351 | // if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop) 1352 | } else if (slideIndex >= getPagerQty()) { 1353 | if (slider.settings.infiniteLoop) { 1354 | return 0; 1355 | } else { 1356 | //we don't move to undefined pages 1357 | return slider.active.index; 1358 | } 1359 | // set active index to requested slide 1360 | } else { 1361 | return slideIndex; 1362 | } 1363 | }; 1364 | 1365 | /** 1366 | * =================================================================================== 1367 | * = PUBLIC FUNCTIONS 1368 | * =================================================================================== 1369 | */ 1370 | 1371 | /** 1372 | * Performs slide transition to the specified slide 1373 | * 1374 | * @param slideIndex (int) 1375 | * - the destination slide's index (zero-based) 1376 | * 1377 | * @param direction (string) 1378 | * - INTERNAL USE ONLY - the direction of travel ("prev" / "next") 1379 | */ 1380 | el.goToSlide = function(slideIndex, direction) { 1381 | // onSlideBefore, onSlideNext, onSlidePrev callbacks 1382 | // Allow transition canceling based on returned value 1383 | var performTransition = true, 1384 | moveBy = 0, 1385 | position = {left: 0, top: 0}, 1386 | lastChild = null, 1387 | lastShowingIndex, eq, value, requestEl; 1388 | // store the old index 1389 | slider.oldIndex = slider.active.index; 1390 | //set new index 1391 | slider.active.index = setSlideIndex(slideIndex); 1392 | 1393 | // if plugin is currently in motion, ignore request 1394 | if (slider.working || slider.active.index === slider.oldIndex) { return; } 1395 | // declare that plugin is in motion 1396 | slider.working = true; 1397 | 1398 | performTransition = slider.settings.onSlideBefore.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); 1399 | 1400 | // If transitions canceled, reset and return 1401 | if (typeof (performTransition) !== 'undefined' && !performTransition) { 1402 | slider.active.index = slider.oldIndex; // restore old index 1403 | slider.working = false; // is not in motion 1404 | return; 1405 | } 1406 | 1407 | if (direction === 'next') { 1408 | // Prevent canceling in future functions or lack there-of from negating previous commands to cancel 1409 | if (!slider.settings.onSlideNext.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) { 1410 | performTransition = false; 1411 | } 1412 | } else if (direction === 'prev') { 1413 | // Prevent canceling in future functions or lack there-of from negating previous commands to cancel 1414 | if (!slider.settings.onSlidePrev.call(el, slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index)) { 1415 | performTransition = false; 1416 | } 1417 | } 1418 | 1419 | // check if last slide 1420 | slider.active.last = slider.active.index >= getPagerQty() - 1; 1421 | // update the pager with active class 1422 | if (slider.settings.pager || slider.settings.pagerCustom) { updatePagerActive(slider.active.index); } 1423 | // // check for direction control update 1424 | if (slider.settings.controls) { updateDirectionControls(); } 1425 | // if slider is set to mode: "fade" 1426 | if (slider.settings.mode === 'fade') { 1427 | // if adaptiveHeight is true and next height is different from current height, animate to the new height 1428 | if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) { 1429 | slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); 1430 | } 1431 | // fade out the visible child and reset its z-index value 1432 | slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0}); 1433 | // fade in the newly requested slide 1434 | slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex + 1).fadeIn(slider.settings.speed, function() { 1435 | $(this).css('zIndex', slider.settings.slideZIndex); 1436 | updateAfterSlideTransition(); 1437 | }); 1438 | // slider mode is not "fade" 1439 | } else { 1440 | // if adaptiveHeight is true and next height is different from current height, animate to the new height 1441 | if (slider.settings.adaptiveHeight && slider.viewport.height() !== getViewportHeight()) { 1442 | slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); 1443 | } 1444 | // if carousel and not infinite loop 1445 | if (!slider.settings.infiniteLoop && slider.carousel && slider.active.last) { 1446 | if (slider.settings.mode === 'horizontal') { 1447 | // get the last child position 1448 | lastChild = slider.children.eq(slider.children.length - 1); 1449 | position = lastChild.position(); 1450 | // calculate the position of the last slide 1451 | moveBy = slider.viewport.width() - lastChild.outerWidth(); 1452 | } else { 1453 | // get last showing index position 1454 | lastShowingIndex = slider.children.length - slider.settings.minSlides; 1455 | position = slider.children.eq(lastShowingIndex).position(); 1456 | } 1457 | // horizontal carousel, going previous while on first slide (infiniteLoop mode) 1458 | } else if (slider.carousel && slider.active.last && direction === 'prev') { 1459 | // get the last child position 1460 | eq = slider.settings.moveSlides === 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides); 1461 | lastChild = el.children('.bx-clone').eq(eq); 1462 | position = lastChild.position(); 1463 | // if infinite loop and "Next" is clicked on the last slide 1464 | } else if (direction === 'next' && slider.active.index === 0) { 1465 | // get the last clone position 1466 | position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position(); 1467 | slider.active.last = false; 1468 | // normal non-zero requests 1469 | } else if (slideIndex >= 0) { 1470 | //parseInt is applied to allow floats for slides/page 1471 | requestEl = slideIndex * parseInt(getMoveBy()); 1472 | position = slider.children.eq(requestEl).position(); 1473 | } 1474 | 1475 | /* If the position doesn't exist 1476 | * (e.g. if you destroy the slider on a next click), 1477 | * it doesn't throw an error. 1478 | */ 1479 | if (typeof (position) !== 'undefined') { 1480 | value = slider.settings.mode === 'horizontal' ? -(position.left - moveBy) : -position.top; 1481 | // plugin values to be animated 1482 | setPositionProperty(value, 'slide', slider.settings.speed); 1483 | } 1484 | slider.working = false; 1485 | } 1486 | if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); } 1487 | }; 1488 | 1489 | /** 1490 | * Transitions to the next slide in the show 1491 | */ 1492 | el.goToNextSlide = function() { 1493 | // if infiniteLoop is false and last page is showing, disregard call 1494 | if (!slider.settings.infiniteLoop && slider.active.last) { return; } 1495 | if (slider.working === true){ return ;} 1496 | var pagerIndex = parseInt(slider.active.index) + 1; 1497 | el.goToSlide(pagerIndex, 'next'); 1498 | }; 1499 | 1500 | /** 1501 | * Transitions to the prev slide in the show 1502 | */ 1503 | el.goToPrevSlide = function() { 1504 | // if infiniteLoop is false and last page is showing, disregard call 1505 | if (!slider.settings.infiniteLoop && slider.active.index === 0) { return; } 1506 | if (slider.working === true){ return ;} 1507 | var pagerIndex = parseInt(slider.active.index) - 1; 1508 | el.goToSlide(pagerIndex, 'prev'); 1509 | }; 1510 | 1511 | /** 1512 | * Starts the auto show 1513 | * 1514 | * @param preventControlUpdate (boolean) 1515 | * - if true, auto controls state will not be updated 1516 | */ 1517 | el.startAuto = function(preventControlUpdate) { 1518 | // if an interval already exists, disregard call 1519 | if (slider.interval) { return; } 1520 | // create an interval 1521 | slider.interval = setInterval(function() { 1522 | if (slider.settings.autoDirection === 'next') { 1523 | el.goToNextSlide(); 1524 | } else { 1525 | el.goToPrevSlide(); 1526 | } 1527 | }, slider.settings.pause); 1528 | //allback for when the auto rotate status changes 1529 | slider.settings.onAutoChange.call(el, true); 1530 | // if auto controls are displayed and preventControlUpdate is not true 1531 | if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('stop'); } 1532 | }; 1533 | 1534 | /** 1535 | * Stops the auto show 1536 | * 1537 | * @param preventControlUpdate (boolean) 1538 | * - if true, auto controls state will not be updated 1539 | */ 1540 | el.stopAuto = function(preventControlUpdate) { 1541 | // if slider is auto paused, just clear that state 1542 | if (slider.autoPaused) slider.autoPaused = false; 1543 | // if no interval exists, disregard call 1544 | if (!slider.interval) { return; } 1545 | // clear the interval 1546 | clearInterval(slider.interval); 1547 | slider.interval = null; 1548 | //allback for when the auto rotate status changes 1549 | slider.settings.onAutoChange.call(el, false); 1550 | // if auto controls are displayed and preventControlUpdate is not true 1551 | if (slider.settings.autoControls && preventControlUpdate !== true) { updateAutoControls('start'); } 1552 | }; 1553 | 1554 | /** 1555 | * Returns current slide index (zero-based) 1556 | */ 1557 | el.getCurrentSlide = function() { 1558 | return slider.active.index; 1559 | }; 1560 | 1561 | /** 1562 | * Returns current slide element 1563 | */ 1564 | el.getCurrentSlideElement = function() { 1565 | return slider.children.eq(slider.active.index); 1566 | }; 1567 | 1568 | /** 1569 | * Returns a slide element 1570 | * @param index (int) 1571 | * - The index (zero-based) of the element you want returned. 1572 | */ 1573 | el.getSlideElement = function(index) { 1574 | return slider.children.eq(index); 1575 | }; 1576 | 1577 | /** 1578 | * Returns number of slides in show 1579 | */ 1580 | el.getSlideCount = function() { 1581 | return slider.children.length; 1582 | }; 1583 | 1584 | /** 1585 | * Return slider.working variable 1586 | */ 1587 | el.isWorking = function() { 1588 | return slider.working; 1589 | }; 1590 | 1591 | /** 1592 | * Update all dynamic slider elements 1593 | */ 1594 | el.redrawSlider = function() { 1595 | // resize all children in ratio to new screen size 1596 | slider.children.add(el.find('.bx-clone')).outerWidth(getSlideWidth()); 1597 | // adjust the height 1598 | slider.viewport.css('height', getViewportHeight()); 1599 | // update the slide position 1600 | if (!slider.settings.ticker) { setSlidePosition(); } 1601 | // if active.last was true before the screen resize, we want 1602 | // to keep it last no matter what screen size we end on 1603 | if (slider.active.last) { slider.active.index = getPagerQty() - 1; } 1604 | // if the active index (page) no longer exists due to the resize, simply set the index as last 1605 | if (slider.active.index >= getPagerQty()) { slider.active.last = true; } 1606 | // if a pager is being displayed and a custom pager is not being used, update it 1607 | if (slider.settings.pager && !slider.settings.pagerCustom) { 1608 | populatePager(); 1609 | updatePagerActive(slider.active.index); 1610 | } 1611 | if (slider.settings.ariaHidden) { applyAriaHiddenAttributes(slider.active.index * getMoveBy()); } 1612 | }; 1613 | 1614 | /** 1615 | * Destroy the current instance of the slider (revert everything back to original state) 1616 | */ 1617 | el.destroySlider = function() { 1618 | // don't do anything if slider has already been destroyed 1619 | if (!slider.initialized) { return; } 1620 | slider.initialized = false; 1621 | $('.bx-clone', this).remove(); 1622 | slider.children.each(function() { 1623 | if ($(this).data('origStyle') !== undefined) { 1624 | $(this).attr('style', $(this).data('origStyle')); 1625 | } else { 1626 | $(this).removeAttr('style'); 1627 | } 1628 | }); 1629 | if ($(this).data('origStyle') !== undefined) { 1630 | this.attr('style', $(this).data('origStyle')); 1631 | } else { 1632 | $(this).removeAttr('style'); 1633 | } 1634 | $(this).unwrap().unwrap(); 1635 | if (slider.controls.el) { slider.controls.el.remove(); } 1636 | if (slider.controls.next) { slider.controls.next.remove(); } 1637 | if (slider.controls.prev) { slider.controls.prev.remove(); } 1638 | if (slider.pagerEl && slider.settings.controls && !slider.settings.pagerCustom) { slider.pagerEl.remove(); } 1639 | $('.bx-caption', this).remove(); 1640 | if (slider.controls.autoEl) { slider.controls.autoEl.remove(); } 1641 | clearInterval(slider.interval); 1642 | if (slider.settings.responsive) { $(window).off('resize', resizeWindow); } 1643 | if (slider.settings.keyboardEnabled) { $(document).off('keydown', keyPress); } 1644 | //remove self reference in data 1645 | $(this).removeData('bxSlider'); 1646 | // remove global window handlers 1647 | $(window).off('blur', windowBlurHandler).off('focus', windowFocusHandler); 1648 | }; 1649 | 1650 | /** 1651 | * Reload the slider (revert all DOM changes, and re-initialize) 1652 | */ 1653 | el.reloadSlider = function(settings) { 1654 | if (settings !== undefined) { options = settings; } 1655 | el.destroySlider(); 1656 | init(); 1657 | //store reference to self in order to access public functions later 1658 | $(el).data('bxSlider', this); 1659 | }; 1660 | 1661 | init(); 1662 | 1663 | $(el).data('bxSlider', this); 1664 | 1665 | // returns the current jQuery object 1666 | return this; 1667 | }; 1668 | 1669 | })(jQuery); 1670 | -------------------------------------------------------------------------------- /dist/jquery.bxslider.min.css: -------------------------------------------------------------------------------- 1 | .bx-wrapper{position:relative;margin-bottom:60px;padding:0;-ms-touch-action:pan-y;touch-action:pan-y;-moz-box-shadow:0 0 5px #ccc;-webkit-box-shadow:0 0 5px #ccc;box-shadow:0 0 5px #ccc;border:5px solid #fff;background:#fff}.bx-wrapper img{max-width:100%;display:block}.bxslider{margin:0;padding:0;-webkit-perspective:1000}ul.bxslider{list-style:none}.bx-viewport{-webkit-transform:translateZ(0)}.bx-wrapper .bx-controls-auto,.bx-wrapper .bx-pager{position:absolute;bottom:-30px;width:100%}.bx-wrapper .bx-loading{min-height:50px;background:url(images/bx_loader.gif) center center no-repeat #fff;height:100%;width:100%;position:absolute;top:0;left:0;z-index:2000}.bx-wrapper .bx-pager{text-align:center;font-size:.85em;font-family:Arial;font-weight:700;color:#666;padding-top:20px}.bx-wrapper .bx-pager.bx-default-pager a{background:#666;text-indent:-9999px;display:block;width:10px;height:10px;margin:0 5px;outline:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.bx-wrapper .bx-pager.bx-default-pager a.active,.bx-wrapper .bx-pager.bx-default-pager a:focus,.bx-wrapper .bx-pager.bx-default-pager a:hover{background:#000}.bx-wrapper .bx-controls-auto .bx-controls-auto-item,.bx-wrapper .bx-pager-item{display:inline-block;vertical-align:bottom}.bx-wrapper .bx-pager-item{font-size:0;line-height:0}.bx-wrapper .bx-prev{left:10px;background:url(images/controls.png) 0 -32px no-repeat}.bx-wrapper .bx-prev:focus,.bx-wrapper .bx-prev:hover{background-position:0 0}.bx-wrapper .bx-next{right:10px;background:url(images/controls.png) -43px -32px no-repeat}.bx-wrapper .bx-next:focus,.bx-wrapper .bx-next:hover{background-position:-43px 0}.bx-wrapper .bx-controls-direction a{position:absolute;top:50%;margin-top:-16px;outline:0;width:32px;height:32px;text-indent:-9999px;z-index:9999}.bx-wrapper .bx-controls-direction a.disabled{display:none}.bx-wrapper .bx-controls-auto{text-align:center}.bx-wrapper .bx-controls-auto .bx-start{display:block;text-indent:-9999px;width:10px;height:11px;outline:0;background:url(images/controls.png) -86px -11px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-start.active,.bx-wrapper .bx-controls-auto .bx-start:focus,.bx-wrapper .bx-controls-auto .bx-start:hover{background-position:-86px 0}.bx-wrapper .bx-controls-auto .bx-stop{display:block;text-indent:-9999px;width:9px;height:11px;outline:0;background:url(images/controls.png) -86px -44px no-repeat;margin:0 3px}.bx-wrapper .bx-controls-auto .bx-stop.active,.bx-wrapper .bx-controls-auto .bx-stop:focus,.bx-wrapper .bx-controls-auto .bx-stop:hover{background-position:-86px -33px}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager{text-align:left;width:80%}.bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto{right:0;width:35px}.bx-wrapper .bx-caption{position:absolute;bottom:0;left:0;background:#666;background:rgba(80,80,80,.75);width:100%}.bx-wrapper .bx-caption span{color:#fff;font-family:Arial;display:block;font-size:.85em;padding:10px} -------------------------------------------------------------------------------- /dist/jquery.bxslider.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bxSlider v4.2.17 3 | * Copyright 2013-2017 Steven Wanderski 4 | * Written while drinking Belgian ales and listening to jazz 5 | * Licensed under MIT (http://opensource.org/licenses/MIT) 6 | */ 7 | !function(t){var e={mode:"horizontal",slideSelector:"",infiniteLoop:!0,hideControlOnEnd:!1,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,slideZIndex:50,wrapperClass:"bx-wrapper",touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,ariaLive:!0,ariaHidden:!0,keyboardEnabled:!1,pager:!0,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,nextText:"Next",prevText:"Prev",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4e3,autoStart:!0,autoDirection:"next",stopAutoOnClick:!1,autoHover:!1,autoDelay:0,autoSlideForOnePage:!1,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,shrinkItems:!1,onSliderLoad:function(){return!0},onSlideBefore:function(){return!0},onSlideAfter:function(){return!0},onSlideNext:function(){return!0},onSlidePrev:function(){return!0},onSliderResize:function(){return!0},onAutoChange:function(){return!0}};t.fn.bxSlider=function(n){if(0===this.length)return this;if(this.length>1)return this.each(function(){t(this).bxSlider(n)}),this;var s={},o=this,r=t(window).width(),a=t(window).height();if(!t(o).data("bxSlider")){var l=function(){t(o).data("bxSlider")||(s.settings=t.extend({},e,n),s.settings.slideWidth=parseInt(s.settings.slideWidth),s.children=o.children(s.settings.slideSelector),s.children.length1||s.settings.maxSlides>1,s.carousel&&(s.settings.preloadImages="all"),s.minThreshold=s.settings.minSlides*s.settings.slideWidth+(s.settings.minSlides-1)*s.settings.slideMargin,s.maxThreshold=s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin,s.working=!1,s.controls={},s.interval=null,s.animProp="vertical"===s.settings.mode?"top":"left",s.usingCSS=s.settings.useCSS&&"fade"!==s.settings.mode&&function(){for(var t=document.createElement("div"),e=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],i=0;i
      '),s.viewport=o.parent(),s.settings.ariaLive&&!s.settings.ticker&&s.viewport.attr("aria-live","polite"),s.loader=t('
      '),s.viewport.prepend(s.loader),o.css({width:"horizontal"===s.settings.mode?1e3*s.children.length+215+"%":"auto",position:"relative"}),s.usingCSS&&s.settings.easing?o.css("-"+s.cssPrefix+"-transition-timing-function",s.settings.easing):s.settings.easing||(s.settings.easing="swing"),s.viewport.css({width:"100%",overflow:"hidden",position:"relative"}),s.viewport.parent().css({maxWidth:u()}),s.children.css({float:"horizontal"===s.settings.mode?"left":"none",listStyle:"none",position:"relative"}),s.children.css("width",h()),"horizontal"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginRight",s.settings.slideMargin),"vertical"===s.settings.mode&&s.settings.slideMargin>0&&s.children.css("marginBottom",s.settings.slideMargin),"fade"===s.settings.mode&&(s.children.css({position:"absolute",zIndex:0,display:"none"}),s.children.eq(s.settings.startSlide).css({zIndex:s.settings.slideZIndex,display:"block"})),s.controls.el=t('
      '),s.settings.captions&&k(),s.active.last=s.settings.startSlide===f()-1,s.settings.video&&o.fitVids(),"none"===s.settings.preloadImages?e=null:("all"===s.settings.preloadImages||s.settings.ticker)&&(e=s.children),s.settings.ticker?s.settings.pager=!1:(s.settings.controls&&C(),s.settings.auto&&s.settings.autoControls&&T(),s.settings.pager&&b(),(s.settings.controls||s.settings.autoControls||s.settings.pager)&&s.viewport.after(s.controls.el)),null===e?g():c(e,g)},c=function(e,i){var n=e.find('img:not([src=""]), iframe').length,s=0;if(0===n)return void i();e.find('img:not([src=""]), iframe').each(function(){t(this).one("load error",function(){++s===n&&i()}).each(function(){(this.complete||""==this.src)&&t(this).trigger("load")})})},g=function(){if(s.settings.infiniteLoop&&"fade"!==s.settings.mode&&!s.settings.ticker){var e="vertical"===s.settings.mode?s.settings.minSlides:s.settings.maxSlides,i=s.children.slice(0,e).clone(!0).addClass("bx-clone"),n=s.children.slice(-e).clone(!0).addClass("bx-clone");s.settings.ariaHidden&&(i.attr("aria-hidden",!0),n.attr("aria-hidden",!0)),o.append(i).prepend(n)}s.loader.remove(),m(),"vertical"===s.settings.mode&&(s.settings.adaptiveHeight=!0),s.viewport.height(p()),o.redrawSlider(),s.settings.onSliderLoad.call(o,s.active.index),s.initialized=!0,s.settings.responsive&&t(window).on("resize",U),s.settings.auto&&s.settings.autoStart&&(f()>1||s.settings.autoSlideForOnePage)&&L(),s.settings.ticker&&O(),s.settings.pager&&z(s.settings.startSlide),s.settings.controls&&q(),s.settings.touchEnabled&&!s.settings.ticker&&X(),s.settings.keyboardEnabled&&!s.settings.ticker&&t(document).keydown(B)},p=function(){var e=0,n=t();if("vertical"===s.settings.mode||s.settings.adaptiveHeight)if(s.carousel){var o=1===s.settings.moveSlides?s.active.index:s.active.index*x();for(n=s.children.eq(o),i=1;i<=s.settings.maxSlides-1;i++)n=o+i>=s.children.length?n.add(s.children.eq(i-1)):n.add(s.children.eq(o+i))}else n=s.children.eq(s.active.index);else n=s.children;return"vertical"===s.settings.mode?(n.each(function(i){e+=t(this).outerHeight()}),s.settings.slideMargin>0&&(e+=s.settings.slideMargin*(s.settings.minSlides-1))):e=Math.max.apply(Math,n.map(function(){return t(this).outerHeight(!1)}).get()),"border-box"===s.viewport.css("box-sizing")?e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))+parseFloat(s.viewport.css("border-top-width"))+parseFloat(s.viewport.css("border-bottom-width")):"padding-box"===s.viewport.css("box-sizing")&&(e+=parseFloat(s.viewport.css("padding-top"))+parseFloat(s.viewport.css("padding-bottom"))),e},u=function(){var t="100%";return s.settings.slideWidth>0&&(t="horizontal"===s.settings.mode?s.settings.maxSlides*s.settings.slideWidth+(s.settings.maxSlides-1)*s.settings.slideMargin:s.settings.slideWidth),t},h=function(){var t=s.settings.slideWidth,e=s.viewport.width();if(0===s.settings.slideWidth||s.settings.slideWidth>e&&!s.carousel||"vertical"===s.settings.mode)t=e;else if(s.settings.maxSlides>1&&"horizontal"===s.settings.mode){if(e>s.maxThreshold)return t;e0?s.viewport.width()s.maxThreshold?t=s.settings.maxSlides:(e=s.children.first().width()+s.settings.slideMargin,t=Math.floor((s.viewport.width()+s.settings.slideMargin)/e)||1):"vertical"===s.settings.mode&&(t=s.settings.minSlides),t},f=function(){var t=0,e=0,i=0;if(s.settings.moveSlides>0){if(!s.settings.infiniteLoop){for(;e0&&s.settings.moveSlides<=v()?s.settings.moveSlides:v()},m=function(){var t,e,i;s.children.length>s.settings.maxSlides&&s.active.last&&!s.settings.infiniteLoop?"horizontal"===s.settings.mode?(e=s.children.last(),t=e.position(),S(-(t.left-(s.viewport.width()-e.outerWidth())),"reset",0)):"vertical"===s.settings.mode&&(i=s.children.length-s.settings.minSlides,t=s.children.eq(i).position(),S(-t.top,"reset",0)):(t=s.children.eq(s.active.index*x()).position(),s.active.index===f()-1&&(s.active.last=!0),void 0!==t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0)))},S=function(e,i,n,r){var a,l;s.usingCSS?(l="vertical"===s.settings.mode?"translate3d(0, "+e+"px, 0)":"translate3d("+e+"px, 0, 0)",o.css("-"+s.cssPrefix+"-transition-duration",n/1e3+"s"),"slide"===i?(o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),A())}):A()):"reset"===i?o.css(s.animProp,l):"ticker"===i&&(o.css("-"+s.cssPrefix+"-transition-timing-function","linear"),o.css(s.animProp,l),0!==n?o.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(e){t(e.target).is(o)&&(o.off("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd"),S(r.resetValue,"reset",0),F())}):(S(r.resetValue,"reset",0),F()))):(a={},a[s.animProp]=e,"slide"===i?o.animate(a,n,s.settings.easing,function(){A()}):"reset"===i?o.css(s.animProp,e):"ticker"===i&&o.animate(a,n,"linear",function(){S(r.resetValue,"reset",0),F()}))},w=function(){for(var e="",i="",n=f(),o=0;o'+i+"
      ";s.pagerEl.html(e)},b=function(){s.settings.pagerCustom?s.pagerEl=t(s.settings.pagerCustom):(s.pagerEl=t('
      '),s.settings.pagerSelector?t(s.settings.pagerSelector).html(s.pagerEl):s.controls.el.addClass("bx-has-pager").append(s.pagerEl),w()),s.pagerEl.on("click touchend","a",I)},C=function(){s.controls.next=t(''+s.settings.nextText+""),s.controls.prev=t(''+s.settings.prevText+""),s.controls.next.on("click touchend",P),s.controls.prev.on("click touchend",E),s.settings.nextSelector&&t(s.settings.nextSelector).append(s.controls.next),s.settings.prevSelector&&t(s.settings.prevSelector).append(s.controls.prev),s.settings.nextSelector||s.settings.prevSelector||(s.controls.directionEl=t('
      '),s.controls.directionEl.append(s.controls.prev).append(s.controls.next),s.controls.el.addClass("bx-has-controls-direction").append(s.controls.directionEl))},T=function(){s.controls.start=t('"),s.controls.stop=t('"),s.controls.autoEl=t('
      '),s.controls.autoEl.on("click",".bx-start",M),s.controls.autoEl.on("click",".bx-stop",y),s.settings.autoControlsCombine?s.controls.autoEl.append(s.controls.start):s.controls.autoEl.append(s.controls.start).append(s.controls.stop),s.settings.autoControlsSelector?t(s.settings.autoControlsSelector).html(s.controls.autoEl):s.controls.el.addClass("bx-has-controls-auto").append(s.controls.autoEl),D(s.settings.autoStart?"stop":"start")},k=function(){s.children.each(function(e){var i=t(this).find("img:first").attr("title");void 0!==i&&(""+i).length&&t(this).append('
      '+i+"
      ")})},P=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToNextSlide())},E=function(t){t.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),o.goToPrevSlide())},M=function(t){o.startAuto(),t.preventDefault()},y=function(t){o.stopAuto(),t.preventDefault()},I=function(e){var i,n;e.preventDefault(),s.controls.el.hasClass("disabled")||(s.settings.auto&&s.settings.stopAutoOnClick&&o.stopAuto(),i=t(e.currentTarget),void 0!==i.attr("data-slide-index")&&(n=parseInt(i.attr("data-slide-index")))!==s.active.index&&o.goToSlide(n))},z=function(e){var i=s.children.length;if("short"===s.settings.pagerType)return s.settings.maxSlides>1&&(i=Math.ceil(s.children.length/s.settings.maxSlides)),void s.pagerEl.html(e+1+s.settings.pagerShortSeparator+i);s.pagerEl.find("a").removeClass("active"),s.pagerEl.each(function(i,n){t(n).find("a").eq(e).addClass("active")})},A=function(){if(s.settings.infiniteLoop){var t="";0===s.active.index?t=s.children.eq(0).position():s.active.index===f()-1&&s.carousel?t=s.children.eq((f()-1)*x()).position():s.active.index===s.children.length-1&&(t=s.children.eq(s.children.length-1).position()),t&&("horizontal"===s.settings.mode?S(-t.left,"reset",0):"vertical"===s.settings.mode&&S(-t.top,"reset",0))}s.working=!1,s.settings.onSlideAfter.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)},D=function(t){s.settings.autoControlsCombine?s.controls.autoEl.html(s.controls[t]):(s.controls.autoEl.find("a").removeClass("active"),s.controls.autoEl.find("a:not(.bx-"+t+")").addClass("active"))},q=function(){1===f()?(s.controls.prev.addClass("disabled"),s.controls.next.addClass("disabled")):!s.settings.infiniteLoop&&s.settings.hideControlOnEnd&&(0===s.active.index?(s.controls.prev.addClass("disabled"),s.controls.next.removeClass("disabled")):s.active.index===f()-1?(s.controls.next.addClass("disabled"),s.controls.prev.removeClass("disabled")):(s.controls.prev.removeClass("disabled"),s.controls.next.removeClass("disabled")))},H=function(){o.startAuto()},W=function(){o.stopAuto()},L=function(){s.settings.autoDelay>0?setTimeout(o.startAuto,s.settings.autoDelay):(o.startAuto(),t(window).focus(H).blur(W)),s.settings.autoHover&&o.hover(function(){s.interval&&(o.stopAuto(!0),s.autoPaused=!0)},function(){s.autoPaused&&(o.startAuto(!0),s.autoPaused=null)})},O=function(){var e,i,n,r,a,l,d,c,g=0;"next"===s.settings.autoDirection?o.append(s.children.clone().addClass("bx-clone")):(o.prepend(s.children.clone().addClass("bx-clone")),e=s.children.first().position(),g="horizontal"===s.settings.mode?-e.left:-e.top),S(g,"reset",0),s.settings.pager=!1,s.settings.controls=!1,s.settings.autoControls=!1,s.settings.tickerHover&&(s.usingCSS?(r="horizontal"===s.settings.mode?4:5,s.viewport.hover(function(){i=o.css("-"+s.cssPrefix+"-transform"),n=parseFloat(i.split(",")[r]),S(n,"reset",0)},function(){c=0,s.children.each(function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)}),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(n))),F(d)})):s.viewport.hover(function(){o.stop()},function(){c=0,s.children.each(function(e){c+="horizontal"===s.settings.mode?t(this).outerWidth(!0):t(this).outerHeight(!0)}),a=s.settings.speed/c,l="horizontal"===s.settings.mode?"left":"top",d=a*(c-Math.abs(parseInt(o.css(l)))),F(d)})),F()},F=function(t){var e,i,n,r=t||s.settings.speed,a={left:0,top:0},l={left:0,top:0};"next"===s.settings.autoDirection?a=o.find(".bx-clone").first().position():l=s.children.first().position(),e="horizontal"===s.settings.mode?-a.left:-a.top,i="horizontal"===s.settings.mode?-l.left:-l.top,n={resetValue:i},S(e,"ticker",r,n)},N=function(e){var i=t(window),n={top:i.scrollTop(),left:i.scrollLeft()},s=e.offset();return n.right=n.left+i.width(),n.bottom=n.top+i.height(),s.right=s.left+e.outerWidth(),s.bottom=s.top+e.outerHeight(),!(n.rights.right||n.bottoms.bottom)},B=function(t){var e=document.activeElement.tagName.toLowerCase();if(null==new RegExp(e,["i"]).exec("input|textarea")&&N(o)){if(39===t.keyCode)return P(t),!1;if(37===t.keyCode)return E(t),!1}},X=function(){s.touch={start:{x:0,y:0},end:{x:0,y:0}},s.viewport.on("touchstart MSPointerDown pointerdown",Y),s.viewport.on("click",".bxslider a",function(t){s.viewport.hasClass("click-disabled")&&(t.preventDefault(),s.viewport.removeClass("click-disabled"))})},Y=function(e){if(!t(e.target).is("a")&&("touchstart"===e.type||0===e.button))if(e.preventDefault(),s.controls.el.addClass("disabled"),s.working)s.controls.el.removeClass("disabled");else{s.touch.originalPos=o.position();var i=e.originalEvent,n=void 0!==i.changedTouches?i.changedTouches:[i],r="function"==typeof PointerEvent;if(r&&void 0===i.pointerId)return;s.touch.start.x=n[0].pageX,s.touch.start.y=n[0].pageY,s.viewport.get(0).setPointerCapture&&(s.pointerId=i.pointerId,s.viewport.get(0).setPointerCapture(s.pointerId)),s.originalClickTarget=i.originalTarget||i.target,s.originalClickButton=i.button,s.originalClickButtons=i.buttons,s.originalEventType=i.type,s.hasMove=!1,s.viewport.on("touchmove MSPointerMove pointermove",R),s.viewport.on("touchend MSPointerUp pointerup",Z),s.viewport.on("MSPointerCancel pointercancel",V)}},V=function(t){t.preventDefault(),S(s.touch.originalPos.left,"reset",0),s.controls.el.removeClass("disabled"),s.viewport.off("MSPointerCancel pointercancel",V),s.viewport.off("touchmove MSPointerMove pointermove",R),s.viewport.off("touchend MSPointerUp pointerup",Z),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId)},R=function(t){var e=t.originalEvent,i=void 0!==e.changedTouches?e.changedTouches:[e],n=Math.abs(i[0].pageX-s.touch.start.x),o=Math.abs(i[0].pageY-s.touch.start.y),r=0,a=0;s.hasMove=!0,3*n>o&&s.settings.preventDefaultSwipeX?t.preventDefault():3*o>n&&s.settings.preventDefaultSwipeY&&t.preventDefault(),"touchmove"!==t.type&&t.preventDefault(),"fade"!==s.settings.mode&&s.settings.oneToOneTouch&&("horizontal"===s.settings.mode?(a=i[0].pageX-s.touch.start.x,r=s.touch.originalPos.left+a):(a=i[0].pageY-s.touch.start.y,r=s.touch.originalPos.top+a),S(r,"reset",0))},Z=function(e){e.preventDefault(),s.viewport.off("touchmove MSPointerMove pointermove",R),s.controls.el.removeClass("disabled");var i=e.originalEvent,n=void 0!==i.changedTouches?i.changedTouches:[i],r=0,a=0;s.touch.end.x=n[0].pageX,s.touch.end.y=n[0].pageY,"fade"===s.settings.mode?(a=Math.abs(s.touch.start.x-s.touch.end.x))>=s.settings.swipeThreshold&&(s.touch.start.x>s.touch.end.x?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):("horizontal"===s.settings.mode?(a=s.touch.end.x-s.touch.start.x,r=s.touch.originalPos.left):(a=s.touch.end.y-s.touch.start.y,r=s.touch.originalPos.top),!s.settings.infiniteLoop&&(0===s.active.index&&a>0||s.active.last&&a<0)?S(r,"reset",200):Math.abs(a)>=s.settings.swipeThreshold?(a<0?o.goToNextSlide():o.goToPrevSlide(),o.stopAuto()):S(r,"reset",200)),s.viewport.off("touchend MSPointerUp pointerup",Z),s.viewport.get(0).releasePointerCapture&&s.viewport.get(0).releasePointerCapture(s.pointerId),!1!==s.hasMove||0!==s.originalClickButton&&"touchstart"!==s.originalEventType||t(s.originalClickTarget).trigger({type:"click",button:s.originalClickButton,buttons:s.originalClickButtons})},U=function(e){if(s.initialized)if(s.working)window.setTimeout(U,10);else{var i=t(window).width(),n=t(window).height();r===i&&a===n||(r=i,a=n,o.redrawSlider(),s.settings.onSliderResize.call(o,s.active.index))}},j=function(t){var e=v();s.settings.ariaHidden&&!s.settings.ticker&&(s.children.attr("aria-hidden","true"),s.children.slice(t,t+e).attr("aria-hidden","false"))},Q=function(t){return t<0?s.settings.infiniteLoop?f()-1:s.active.index:t>=f()?s.settings.infiniteLoop?0:s.active.index:t};return o.goToSlide=function(e,i){var n,r,a,l,d=!0,c=0,g={left:0,top:0},u=null;if(s.oldIndex=s.active.index,s.active.index=Q(e),!s.working&&s.active.index!==s.oldIndex){if(s.working=!0,void 0!==(d=s.settings.onSlideBefore.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index))&&!d)return s.active.index=s.oldIndex,void(s.working=!1);"next"===i?s.settings.onSlideNext.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1):"prev"===i&&(s.settings.onSlidePrev.call(o,s.children.eq(s.active.index),s.oldIndex,s.active.index)||(d=!1)),s.active.last=s.active.index>=f()-1,(s.settings.pager||s.settings.pagerCustom)&&z(s.active.index),s.settings.controls&&q(),"fade"===s.settings.mode?(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),s.children.filter(":visible").fadeOut(s.settings.speed).css({zIndex:0}),s.children.eq(s.active.index).css("zIndex",s.settings.slideZIndex+1).fadeIn(s.settings.speed,function(){t(this).css("zIndex",s.settings.slideZIndex),A()})):(s.settings.adaptiveHeight&&s.viewport.height()!==p()&&s.viewport.animate({height:p()},s.settings.adaptiveHeightSpeed),!s.settings.infiniteLoop&&s.carousel&&s.active.last?"horizontal"===s.settings.mode?(u=s.children.eq(s.children.length-1),g=u.position(),c=s.viewport.width()-u.outerWidth()):(n=s.children.length-s.settings.minSlides,g=s.children.eq(n).position()):s.carousel&&s.active.last&&"prev"===i?(r=1===s.settings.moveSlides?s.settings.maxSlides-x():(f()-1)*x()-(s.children.length-s.settings.maxSlides),u=o.children(".bx-clone").eq(r),g=u.position()):"next"===i&&0===s.active.index?(g=o.find("> .bx-clone").eq(s.settings.maxSlides).position(),s.active.last=!1):e>=0&&(l=e*parseInt(x()),g=s.children.eq(l).position()),void 0!==g&&(a="horizontal"===s.settings.mode?-(g.left-c):-g.top,S(a,"slide",s.settings.speed)),s.working=!1),s.settings.ariaHidden&&j(s.active.index*x())}},o.goToNextSlide=function(){if((s.settings.infiniteLoop||!s.active.last)&&!0!==s.working){var t=parseInt(s.active.index)+1;o.goToSlide(t,"next")}},o.goToPrevSlide=function(){if((s.settings.infiniteLoop||0!==s.active.index)&&!0!==s.working){var t=parseInt(s.active.index)-1;o.goToSlide(t,"prev")}},o.startAuto=function(t){s.interval||(s.interval=setInterval(function(){"next"===s.settings.autoDirection?o.goToNextSlide():o.goToPrevSlide()},s.settings.pause),s.settings.onAutoChange.call(o,!0),s.settings.autoControls&&!0!==t&&D("stop"))},o.stopAuto=function(t){s.autoPaused&&(s.autoPaused=!1),s.interval&&(clearInterval(s.interval),s.interval=null,s.settings.onAutoChange.call(o,!1),s.settings.autoControls&&!0!==t&&D("start"))},o.getCurrentSlide=function(){return s.active.index},o.getCurrentSlideElement=function(){return s.children.eq(s.active.index)},o.getSlideElement=function(t){return s.children.eq(t)},o.getSlideCount=function(){return s.children.length},o.isWorking=function(){return s.working},o.redrawSlider=function(){s.children.add(o.find(".bx-clone")).outerWidth(h()),s.viewport.css("height",p()),s.settings.ticker||m(),s.active.last&&(s.active.index=f()-1),s.active.index>=f()&&(s.active.last=!0),s.settings.pager&&!s.settings.pagerCustom&&(w(),z(s.active.index)),s.settings.ariaHidden&&j(s.active.index*x())},o.destroySlider=function(){s.initialized&&(s.initialized=!1,t(".bx-clone",this).remove(),s.children.each(function(){void 0!==t(this).data("origStyle")?t(this).attr("style",t(this).data("origStyle")):t(this).removeAttr("style")}),void 0!==t(this).data("origStyle")?this.attr("style",t(this).data("origStyle")):t(this).removeAttr("style"),t(this).unwrap().unwrap(),s.controls.el&&s.controls.el.remove(),s.controls.next&&s.controls.next.remove(),s.controls.prev&&s.controls.prev.remove(),s.pagerEl&&s.settings.controls&&!s.settings.pagerCustom&&s.pagerEl.remove(),t(".bx-caption",this).remove(),s.controls.autoEl&&s.controls.autoEl.remove(),clearInterval(s.interval),s.settings.responsive&&t(window).off("resize",U),s.settings.keyboardEnabled&&t(document).off("keydown",B),t(this).removeData("bxSlider"),t(window).off("blur",W).off("focus",H))},o.reloadSlider=function(e){void 0!==e&&(n=e),o.destroySlider(),l(),t(o).data("bxSlider",this)},l(),t(o).data("bxSlider",this),this}}}(jQuery); -------------------------------------------------------------------------------- /dist/vendor/jquery.easing.1.3.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - jQuery Easing 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2008 George McGinley Smith 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 17 | * Redistributions of source code must retain the above copyright notice, this list of 18 | * conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright notice, this list 20 | * of conditions and the following disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * Neither the name of the author nor the names of contributors may be used to endorse 24 | * or promote products derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 29 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 32 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 34 | * OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // t: current time, b: begInnIng value, c: change In value, d: duration 39 | jQuery.easing['jswing'] = jQuery.easing['swing']; 40 | 41 | jQuery.extend( jQuery.easing, 42 | { 43 | def: 'easeOutQuad', 44 | swing: function (x, t, b, c, d) { 45 | //alert(jQuery.easing.default); 46 | return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 47 | }, 48 | easeInQuad: function (x, t, b, c, d) { 49 | return c*(t/=d)*t + b; 50 | }, 51 | easeOutQuad: function (x, t, b, c, d) { 52 | return -c *(t/=d)*(t-2) + b; 53 | }, 54 | easeInOutQuad: function (x, t, b, c, d) { 55 | if ((t/=d/2) < 1) return c/2*t*t + b; 56 | return -c/2 * ((--t)*(t-2) - 1) + b; 57 | }, 58 | easeInCubic: function (x, t, b, c, d) { 59 | return c*(t/=d)*t*t + b; 60 | }, 61 | easeOutCubic: function (x, t, b, c, d) { 62 | return c*((t=t/d-1)*t*t + 1) + b; 63 | }, 64 | easeInOutCubic: function (x, t, b, c, d) { 65 | if ((t/=d/2) < 1) return c/2*t*t*t + b; 66 | return c/2*((t-=2)*t*t + 2) + b; 67 | }, 68 | easeInQuart: function (x, t, b, c, d) { 69 | return c*(t/=d)*t*t*t + b; 70 | }, 71 | easeOutQuart: function (x, t, b, c, d) { 72 | return -c * ((t=t/d-1)*t*t*t - 1) + b; 73 | }, 74 | easeInOutQuart: function (x, t, b, c, d) { 75 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 76 | return -c/2 * ((t-=2)*t*t*t - 2) + b; 77 | }, 78 | easeInQuint: function (x, t, b, c, d) { 79 | return c*(t/=d)*t*t*t*t + b; 80 | }, 81 | easeOutQuint: function (x, t, b, c, d) { 82 | return c*((t=t/d-1)*t*t*t*t + 1) + b; 83 | }, 84 | easeInOutQuint: function (x, t, b, c, d) { 85 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 86 | return c/2*((t-=2)*t*t*t*t + 2) + b; 87 | }, 88 | easeInSine: function (x, t, b, c, d) { 89 | return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 90 | }, 91 | easeOutSine: function (x, t, b, c, d) { 92 | return c * Math.sin(t/d * (Math.PI/2)) + b; 93 | }, 94 | easeInOutSine: function (x, t, b, c, d) { 95 | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 96 | }, 97 | easeInExpo: function (x, t, b, c, d) { 98 | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 99 | }, 100 | easeOutExpo: function (x, t, b, c, d) { 101 | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 102 | }, 103 | easeInOutExpo: function (x, t, b, c, d) { 104 | if (t==0) return b; 105 | if (t==d) return b+c; 106 | if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 107 | return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 108 | }, 109 | easeInCirc: function (x, t, b, c, d) { 110 | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 111 | }, 112 | easeOutCirc: function (x, t, b, c, d) { 113 | return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 114 | }, 115 | easeInOutCirc: function (x, t, b, c, d) { 116 | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 117 | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 118 | }, 119 | easeInElastic: function (x, t, b, c, d) { 120 | var s=1.70158;var p=0;var a=c; 121 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 122 | if (a < Math.abs(c)) { a=c; var s=p/4; } 123 | else var s = p/(2*Math.PI) * Math.asin (c/a); 124 | return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 125 | }, 126 | easeOutElastic: function (x, t, b, c, d) { 127 | var s=1.70158;var p=0;var a=c; 128 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 129 | if (a < Math.abs(c)) { a=c; var s=p/4; } 130 | else var s = p/(2*Math.PI) * Math.asin (c/a); 131 | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 132 | }, 133 | easeInOutElastic: function (x, t, b, c, d) { 134 | var s=1.70158;var p=0;var a=c; 135 | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 136 | if (a < Math.abs(c)) { a=c; var s=p/4; } 137 | else var s = p/(2*Math.PI) * Math.asin (c/a); 138 | if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 139 | return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 140 | }, 141 | easeInBack: function (x, t, b, c, d, s) { 142 | if (s == undefined) s = 1.70158; 143 | return c*(t/=d)*t*((s+1)*t - s) + b; 144 | }, 145 | easeOutBack: function (x, t, b, c, d, s) { 146 | if (s == undefined) s = 1.70158; 147 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 148 | }, 149 | easeInOutBack: function (x, t, b, c, d, s) { 150 | if (s == undefined) s = 1.70158; 151 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 152 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 153 | }, 154 | easeInBounce: function (x, t, b, c, d) { 155 | return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 156 | }, 157 | easeOutBounce: function (x, t, b, c, d) { 158 | if ((t/=d) < (1/2.75)) { 159 | return c*(7.5625*t*t) + b; 160 | } else if (t < (2/2.75)) { 161 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 162 | } else if (t < (2.5/2.75)) { 163 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 164 | } else { 165 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 166 | } 167 | }, 168 | easeInOutBounce: function (x, t, b, c, d) { 169 | if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 170 | return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 171 | } 172 | }); 173 | 174 | /* 175 | * 176 | * TERMS OF USE - EASING EQUATIONS 177 | * 178 | * Open source under the BSD License. 179 | * 180 | * Copyright © 2001 Robert Penner 181 | * All rights reserved. 182 | * 183 | * Redistribution and use in source and binary forms, with or without modification, 184 | * are permitted provided that the following conditions are met: 185 | * 186 | * Redistributions of source code must retain the above copyright notice, this list of 187 | * conditions and the following disclaimer. 188 | * Redistributions in binary form must reproduce the above copyright notice, this list 189 | * of conditions and the following disclaimer in the documentation and/or other materials 190 | * provided with the distribution. 191 | * 192 | * Neither the name of the author nor the names of contributors may be used to endorse 193 | * or promote products derived from this software without specific prior written permission. 194 | * 195 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 196 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 197 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 198 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 199 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 200 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 201 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 202 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 203 | * OF THE POSSIBILITY OF SUCH DAMAGE. 204 | * 205 | */ -------------------------------------------------------------------------------- /dist/vendor/jquery.fitvids.js: -------------------------------------------------------------------------------- 1 | /*global jQuery */ 2 | /*jshint multistr:true browser:true */ 3 | /*! 4 | * FitVids 1.0 5 | * 6 | * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 7 | * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 8 | * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 9 | * 10 | * Date: Thu Sept 01 18:00:00 2011 -0500 11 | */ 12 | 13 | (function( $ ){ 14 | 15 | "use strict"; 16 | 17 | $.fn.fitVids = function( options ) { 18 | var settings = { 19 | customSelector: null 20 | }; 21 | 22 | var div = document.createElement('div'), 23 | ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; 24 | 25 | div.className = 'fit-vids-style'; 26 | div.innerHTML = '­'; 43 | 44 | ref.parentNode.insertBefore(div,ref); 45 | 46 | if ( options ) { 47 | $.extend( settings, options ); 48 | } 49 | 50 | return this.each(function(){ 51 | var selectors = [ 52 | "iframe[src*='player.vimeo.com']", 53 | "iframe[src*='www.youtube.com']", 54 | "iframe[src*='www.kickstarter.com']", 55 | "object", 56 | "embed" 57 | ]; 58 | 59 | if (settings.customSelector) { 60 | selectors.push(settings.customSelector); 61 | } 62 | 63 | var $allVideos = $(this).find(selectors.join(',')); 64 | 65 | $allVideos.each(function(){ 66 | var $this = $(this); 67 | if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } 68 | var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), 69 | width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), 70 | aspectRatio = height / width; 71 | if(!$this.attr('id')){ 72 | var videoID = 'fitvid' + Math.floor(Math.random()*999999); 73 | $this.attr('id', videoID); 74 | } 75 | $this.wrap('
      ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); 76 | $this.removeAttr('height').removeAttr('width'); 77 | }); 78 | }); 79 | }; 80 | })( jQuery ); 81 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bxslider", 3 | "description": "Touch enabled jQuery plugin for creating responsive carousels and sliders.", 4 | "version": "4.2.17", 5 | "homepage": "https://bxslider.com", 6 | "author": { 7 | "name": "Steven Wanderski", 8 | "email": "steven.wanderski@gmail.com", 9 | "url": "https://stevenwanderski.com" 10 | }, 11 | "license": "MIT", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/stevenwanderski/bxslider-4/bxslider-4.git" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/stevenwanderski/bxslider-4/issues" 18 | }, 19 | "devDependencies": { 20 | "gulp": "^5.0.0", 21 | "gulp-cssmin": "^0.1.7", 22 | "gulp-rename": "^1.2.2", 23 | "gulp-uglify": "^2.0.1" 24 | }, 25 | "engines": { 26 | "node": ">=0.10.28" 27 | }, 28 | "keywords": [ 29 | "responsive", 30 | "carousel", 31 | "bxslider", 32 | "jQuery", 33 | "plugin" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # bxSlider 4.2.17 2 | ## The fully-loaded, responsive jQuery content slider 3 | 4 | ### Why should I use this slider? 5 | * Fully responsive - will adapt to any device 6 | * Horizontal, vertical, and fade modes 7 | * Slides can contain images, video, or HTML content 8 | * Full callback API and public methods 9 | * Small file size, fully themed, simple to implement 10 | * Browser support: Firefox, Chrome, Safari, iOS, Android, IE7+ 11 | * Tons of configuration options 12 | 13 | For complete documentation, tons of examples, and a good time, visit: [http://bxslider.com](http://bxslider.com) 14 | 15 | Written by: Steven Wanderski - [http://stevenwanderski.com](http://stevenwanderski.com) 16 | 17 | ### License 18 | Released under the MIT license - http://opensource.org/licenses/MIT 19 | 20 | Let's get on with it! 21 | 22 | ## Installation 23 | 24 | ### Step 1: Link required files 25 | 26 | First and most important, the jQuery library needs to be included (no need to download - link directly from Google). Next, download the package from this site and link the bxSlider CSS file (for the theme) and the bxSlider Javascript file. 27 | 28 | ```html 29 | 30 | 31 | 32 | 33 | 34 | 35 | ``` 36 | 37 | Or, if you prefer, you can get the bxSlider's resources from the **CDN**: 38 | 39 | ```html 40 | 41 | 42 | ``` 43 | 44 | ### Step 2: Create HTML markup 45 | 46 | Create a `
        ` element, with a `
      • ` for each slide. Slides can contain images, video, or any other HTML content! 47 | 48 | ```html 49 |
          50 |
        • 51 |
        • 52 |
        • 53 |
        • 54 |
        55 | ``` 56 | 57 | ### Step 3: Call the bxSlider 58 | 59 | Call .bxSlider() on `
          `. Note that the call must be made inside of a $(document).ready() call, or the plugin will not work! 60 | 61 | ```javascript 62 | $(document).ready(function(){ 63 | $('.bxslider').bxSlider(); 64 | }); 65 | ``` 66 | 67 | ## Configuration options 68 | 69 | ### General 70 | 71 | **mode** 72 | 73 | Type of transition between slides 74 | ``` 75 | default: 'horizontal' 76 | options: 'horizontal', 'vertical', 'fade' 77 | ``` 78 | 79 | **speed** 80 | 81 | Slide transition duration (in ms) 82 | ``` 83 | default: 500 84 | options: integer 85 | ``` 86 | 87 | **slideMargin** 88 | 89 | Margin between each slide 90 | ``` 91 | default: 0 92 | options: integer 93 | ``` 94 | 95 | **startSlide** 96 | 97 | Starting slide index (zero-based) 98 | ``` 99 | default: 0 100 | options: integer 101 | ``` 102 | 103 | **randomStart** 104 | 105 | Start slider on a random slide 106 | ``` 107 | default: false 108 | options: boolean (true / false) 109 | ``` 110 | 111 | **slideSelector** 112 | 113 | Element to use as slides (ex. 'div.slide').
          Note: by default, bxSlider will use all immediate children of the slider element 114 | ``` 115 | default: '' 116 | options: jQuery selector 117 | ``` 118 | 119 | **infiniteLoop** 120 | 121 | If true, clicking "Next" while on the last slide will transition to the first slide and vice-versa 122 | ``` 123 | default: true 124 | options: boolean (true / false) 125 | ``` 126 | 127 | **hideControlOnEnd** 128 | 129 | If true, "Prev" and "Next" controls will receive a class disabled when slide is the first or the last
          Note: Only used when infiniteLoop: false 130 | ``` 131 | default: false 132 | options: boolean (true / false) 133 | ``` 134 | 135 | **easing** 136 | 137 | The type of "easing" to use during transitions. If using CSS transitions, include a value for the transition-timing-function property. If not using CSS transitions, you may include plugins/jquery.easing.1.3.js for many options.
          See http://gsgd.co.uk/sandbox/jquery/easing/ for more info. 138 | ``` 139 | default: null 140 | options: if using CSS: 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'cubic-bezier(n,n,n,n)'. If not using CSS: 'swing', 'linear' (see the above file for more options) 141 | ``` 142 | 143 | **captions** 144 | 145 | Include image captions. Captions are derived from the image's title attribute 146 | ``` 147 | default: false 148 | options: boolean (true / false) 149 | ``` 150 | 151 | **ticker** 152 | 153 | Use slider in ticker mode (similar to a news ticker) 154 | ``` 155 | default: false 156 | options: boolean (true / false) 157 | ``` 158 | 159 | **tickerHover** 160 | 161 | Ticker will pause when mouse hovers over slider. Note: this functionality does NOT work if using CSS transitions! 162 | ``` 163 | default: false 164 | options: boolean (true / false) 165 | ``` 166 | 167 | **adaptiveHeight** 168 | 169 | Dynamically adjust slider height based on each slide's height 170 | ``` 171 | default: false 172 | options: boolean (true / false) 173 | ``` 174 | 175 | **adaptiveHeightSpeed** 176 | 177 | Slide height transition duration (in ms). Note: only used if adaptiveHeight: true 178 | ``` 179 | default: 500 180 | options: integer 181 | ``` 182 | 183 | **video** 184 | 185 | If any slides contain video, set this to true. Also, include plugins/jquery.fitvids.js
          See http://fitvidsjs.com/ for more info 186 | ``` 187 | default: false 188 | options: boolean (true / false) 189 | ``` 190 | 191 | **responsive** 192 | 193 | Enable or disable auto resize of the slider. Useful if you need to use fixed width sliders. 194 | ``` 195 | default: true 196 | options: boolean (true /false) 197 | ``` 198 | 199 | **useCSS** 200 | 201 | If true, CSS transitions will be used for horizontal and vertical slide animations (this uses native hardware acceleration). If false, jQuery animate() will be used. 202 | ``` 203 | default: true 204 | options: boolean (true / false) 205 | ``` 206 | 207 | **preloadImages** 208 | 209 | If 'all', preloads all images before starting the slider. If 'visible', preloads only images in the initially visible slides before starting the slider (tip: use 'visible' if all slides are identical dimensions) 210 | ``` 211 | default: 'visible' 212 | options: 'all', 'visible', 'none' 213 | ``` 214 | 215 | **touchEnabled** 216 | 217 | If true, slider will allow touch swipe transitions 218 | ``` 219 | default: true 220 | options: boolean (true / false) 221 | ``` 222 | 223 | **swipeThreshold** 224 | 225 | Amount of pixels a touch swipe needs to exceed in order to execute a slide transition. Note: only used if touchEnabled: true 226 | ``` 227 | default: 50 228 | options: integer 229 | ``` 230 | 231 | **oneToOneTouch** 232 | 233 | If true, non-fade slides follow the finger as it swipes 234 | ``` 235 | default: true 236 | options: boolean (true / false) 237 | ``` 238 | 239 | **preventDefaultSwipeX** 240 | 241 | If true, touch screen will not move along the x-axis as the finger swipes 242 | ``` 243 | default: true 244 | options: boolean (true / false) 245 | ``` 246 | 247 | **preventDefaultSwipeY** 248 | 249 | If true, touch screen will not move along the y-axis as the finger swipes 250 | ``` 251 | default: false 252 | options: boolean (true / false) 253 | ``` 254 | 255 | **wrapperClass** 256 | 257 | Class to wrap the slider in. Change to prevent from using default bxSlider styles. 258 | ``` 259 | default: 'bx-wrapper' 260 | options: string 261 | ``` 262 | 263 | ### Pager 264 | 265 | **pager** 266 | 267 | If true, a pager will be added 268 | ``` 269 | default: true 270 | options: boolean (true / false) 271 | ``` 272 | 273 | **pagerType** 274 | 275 | If 'full', a pager link will be generated for each slide. If 'short', a x / y pager will be used (ex. 1 / 5) 276 | ``` 277 | default: 'full' 278 | options: 'full', 'short' 279 | ``` 280 | 281 | **pagerShortSeparator** 282 | 283 | If pagerType: 'short', pager will use this value as the separating character 284 | ``` 285 | default: ' / ' 286 | options: string 287 | ``` 288 | 289 | **pagerSelector** 290 | 291 | Element used to populate the populate the pager. By default, the pager is appended to the bx-viewport 292 | ``` 293 | default: '' 294 | options: jQuery selector 295 | ``` 296 | 297 | **pagerCustom** 298 | 299 | Parent element to be used as the pager. Parent element must contain a <a data-slide-index="x"> element for each slide. See example here. Not for use with dynamic carousels. 300 | ``` 301 | default: null 302 | options: jQuery selector 303 | ``` 304 | 305 | **buildPager** 306 | 307 | If supplied, function is called on every slide element, and the returned value is used as the pager item markup.
          See examples for detailed implementation 308 | ``` 309 | default: null 310 | options: function(slideIndex) 311 | ``` 312 | 313 | ### Controls 314 | 315 | **controls** 316 | 317 | If true, "Next" / "Prev" controls will be added 318 | ``` 319 | default: true 320 | options: boolean (true / false) 321 | ``` 322 | 323 | **nextText** 324 | 325 | Text to be used for the "Next" control 326 | ``` 327 | default: 'Next' 328 | options: string 329 | ``` 330 | 331 | **prevText** 332 | 333 | Text to be used for the "Prev" control 334 | ``` 335 | default: 'Prev' 336 | options: string 337 | ``` 338 | 339 | **nextSelector** 340 | 341 | Element used to populate the "Next" control 342 | ``` 343 | default: null 344 | options: jQuery selector 345 | ``` 346 | 347 | **prevSelector** 348 | 349 | Element used to populate the "Prev" control 350 | ``` 351 | default: null 352 | options: jQuery selector 353 | ``` 354 | 355 | **autoControls** 356 | 357 | If true, "Start" / "Stop" controls will be added 358 | ``` 359 | default: false 360 | options: boolean (true / false) 361 | ``` 362 | 363 | **startText** 364 | 365 | Text to be used for the "Start" control 366 | ``` 367 | default: 'Start' 368 | options: string 369 | ``` 370 | 371 | **stopText** 372 | 373 | Text to be used for the "Stop" control 374 | ``` 375 | default: 'Stop' 376 | options: string 377 | ``` 378 | 379 | **autoControlsCombine** 380 | 381 | When slideshow is playing only "Stop" control is displayed and vice-versa 382 | ``` 383 | default: false 384 | options: boolean (true / false) 385 | ``` 386 | 387 | **autoControlsSelector** 388 | 389 | Element used to populate the auto controls 390 | ``` 391 | default: null 392 | options: jQuery selector 393 | ``` 394 | 395 | **keyboardEnabled** 396 | 397 | Enable keyboard navigation for visible sliders 398 | ``` 399 | default: false 400 | options: boolean (true / false) 401 | ``` 402 | 403 | ### Auto 404 | 405 | **auto** 406 | 407 | Slides will automatically transition 408 | ``` 409 | default: false 410 | options: boolean (true / false) 411 | ``` 412 | **stopAutoOnClick** 413 | 414 | Auto will stop on interaction with controls 415 | ``` 416 | default: false 417 | options: boolean (true / false) 418 | ``` 419 | 420 | **pause** 421 | 422 | The amount of time (in ms) between each auto transition 423 | ``` 424 | default: 4000 425 | options: integer 426 | ``` 427 | 428 | **autoStart** 429 | 430 | Auto show starts playing on load. If false, slideshow will start when the "Start" control is clicked 431 | ``` 432 | default: true 433 | options: boolean (true / false) 434 | ``` 435 | 436 | **autoDirection** 437 | 438 | The direction of auto show slide transitions 439 | ``` 440 | default: 'next' 441 | options: 'next', 'prev' 442 | ``` 443 | 444 | **autoHover** 445 | 446 | Auto show will pause when mouse hovers over slider 447 | ``` 448 | default: false 449 | options: boolean (true / false) 450 | ``` 451 | 452 | **autoDelay** 453 | 454 | Time (in ms) auto show should wait before starting 455 | ``` 456 | default: 0 457 | options: integer 458 | ``` 459 | 460 | ### Carousel 461 | 462 | **minSlides** 463 | 464 | The minimum number of slides to be shown. Slides will be sized down if carousel becomes smaller than the original size. 465 | ``` 466 | default: 1 467 | options: integer 468 | ``` 469 | 470 | **maxSlides** 471 | 472 | The maximum number of slides to be shown. Slides will be sized up if carousel becomes larger than the original size. 473 | ``` 474 | default: 1 475 | options: integer 476 | ``` 477 | 478 | **moveSlides** 479 | 480 | The number of slides to move on transition. This value must be `>= minSlides`, and `<= maxSlides`. If zero (default), the number of fully-visible slides will be used. 481 | ``` 482 | default: 0 483 | options: integer 484 | ``` 485 | 486 | **slideWidth** 487 | 488 | The width of each slide. This setting is required for all horizontal carousels! 489 | ``` 490 | default: 0 491 | options: integer 492 | ``` 493 | 494 | **shrinkItems** 495 | 496 | The Carousel will only show whole items and shrink the images to fit the viewport based on maxSlides/MinSlides. 497 | ``` 498 | default: false 499 | options: boolean (true / false) 500 | ``` 501 | 502 | ### Keyboard 503 | 504 | **keyboardEnabled** 505 | 506 | Allows for keyboard control of visible slider. Keypress ignored if slider not visible. 507 | ``` 508 | default: false 509 | options: boolean (true / false) 510 | ``` 511 | 512 | ### Accessibility 513 | 514 | **ariaLive** 515 | 516 | Adds Aria Live attribute to slider. 517 | ``` 518 | default: true 519 | options: boolean (true / false) 520 | ``` 521 | 522 | **ariaHidden** 523 | 524 | Adds Aria Hidden attribute to any nonvisible slides. 525 | ``` 526 | default: true 527 | options: boolean (true / false) 528 | ``` 529 | 530 | ### Callbacks 531 | 532 | **onSliderLoad** 533 | 534 | Executes immediately after the slider is fully loaded 535 | ``` 536 | default: function(){} 537 | options: function(currentIndex){ // your code here } 538 | arguments: 539 | currentIndex: element index of the current slide 540 | ``` 541 | 542 | **onSliderResize** 543 | 544 | Executes immediately after the slider is resized 545 | ``` 546 | default: function(){} 547 | options: function(currentIndex){ // your code here } 548 | arguments: 549 | currentIndex: element index of the current slide 550 | ``` 551 | 552 | **onSlideBefore** 553 | 554 | Executes immediately before each slide transition. 555 | ``` 556 | default: function(){} 557 | options: function($slideElement, oldIndex, newIndex){ // your code here } 558 | arguments: 559 | $slideElement: jQuery element of the destination element 560 | oldIndex: element index of the previous slide (before the transition) 561 | newIndex: element index of the destination slide (after the transition) 562 | ``` 563 | 564 | **onSlideAfter** 565 | 566 | Executes immediately after each slide transition. Function argument is the current slide element (when transition completes). 567 | ``` 568 | default: function(){} 569 | options: function($slideElement, oldIndex, newIndex){ // your code here } 570 | arguments: 571 | $slideElement: jQuery element of the destination element 572 | oldIndex: element index of the previous slide (before the transition) 573 | newIndex: element index of the destination slide (after the transition) 574 | ``` 575 | 576 | **onSlideNext** 577 | 578 | Executes immediately before each "Next" slide transition. Function argument is the target (next) slide element. 579 | ``` 580 | default: function(){} 581 | options: function($slideElement, oldIndex, newIndex){ // your code here } 582 | arguments: 583 | $slideElement: jQuery element of the destination element 584 | oldIndex: element index of the previous slide (before the transition) 585 | newIndex: element index of the destination slide (after the transition) 586 | ``` 587 | 588 | **onSlidePrev** 589 | 590 | Executes immediately before each "Prev" slide transition. Function argument is the target (prev) slide element. 591 | ``` 592 | default: function(){} 593 | options: function($slideElement, oldIndex, newIndex){ // your code here } 594 | arguments: 595 | $slideElement: jQuery element of the destination element 596 | oldIndex: element index of the previous slide (before the transition) 597 | newIndex: element index of the destination slide (after the transition) 598 | ``` 599 | 600 | **onAutoChange** 601 | 602 | Executes immediately after auto transtion starts or stops. 603 | ``` 604 | default: function(){} 605 | options: function(state){ // your code here } 606 | arguments: 607 | state: the new state of "auto": boolean (true / false) 608 | ``` 609 | 610 | ### Public methods 611 | 612 | **goToSlide** 613 | 614 | Performs a slide transition to the supplied slide index (zero-based) 615 | ``` 616 | example: 617 | slider = $('.bxslider').bxSlider(); 618 | slider.goToSlide(3); 619 | ``` 620 | 621 | **goToNextSlide** 622 | 623 | Performs a "Next" slide transition 624 | ``` 625 | example: 626 | slider = $('.bxslider').bxSlider(); 627 | slider.goToNextSlide(); 628 | ``` 629 | 630 | **goToPrevSlide** 631 | 632 | Performs a "Prev" slide transition 633 | ``` 634 | example: 635 | slider = $('.bxslider').bxSlider(); 636 | slider.goToPrevSlide(); 637 | ``` 638 | 639 | **startAuto** 640 | Starts the auto show. Provide an argument `false` to prevent the auto controls from being updated. 641 | ``` 642 | example: 643 | slider = $('.bxslider').bxSlider(); 644 | slider.startAuto(); 645 | ``` 646 | 647 | **stopAuto** 648 | 649 | Stops the auto show. Provide an argument `false` to prevent the auto controls from being updated. 650 | ``` 651 | example: 652 | slider = $('.bxslider').bxSlider(); 653 | slider.stopAuto(); 654 | ``` 655 | 656 | **getCurrentSlide** 657 | 658 | Returns the current active slide 659 | ``` 660 | example: 661 | slider = $('.bxslider').bxSlider(); 662 | var current = slider.getCurrentSlide(); 663 | ``` 664 | 665 | **getSlideCount** 666 | 667 | Returns the total number of slides in the slider 668 | ``` 669 | example: 670 | slider = $('.bxslider').bxSlider(); 671 | var slideQty = slider.getSlideCount(); 672 | ``` 673 | 674 | **redrawSlider** 675 | 676 | Redraw the slider. Useful when needing to redraw a hidden slider after it is unhidden. 677 | ``` 678 | example: 679 | slider = $('.bxslider').bxSlider(); 680 | slider.redrawSlider(); 681 | ``` 682 | 683 | **reloadSlider** 684 | 685 | Reload the slider. Useful when adding slides on the fly. Accepts an optional settings object. 686 | ``` 687 | example: 688 | slider = $('.bxslider').bxSlider(); 689 | slider.reloadSlider(); 690 | ``` 691 | 692 | **destroySlider** 693 | 694 | Destroy the slider. This reverts all slider elements back to their original state (before calling the slider). 695 | ``` 696 | example: 697 | slider = $('.bxslider').bxSlider(); 698 | slider.destroySlider(); 699 | ``` 700 | 701 | ### Local Development with Gulp 702 | 703 | **Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding. 704 | 705 | From the command line: 706 | 707 | 1. Install the CLI: `npm install --global gulp-cli` 708 | 2. Run `npm install` to install local development tools 709 | 3. Run `gulp` which will build the project 710 | 711 | ## Contributing 712 | 713 | Everyone is welcome to help [contribute](CONTRIBUTING.md) and improve this project. There are several ways you can contribute: 714 | 715 | * Reporting issues (please read [issue guidelines](https://github.com/necolas/issue-guidelines)) 716 | * Suggesting new features 717 | * Writing or refactoring code 718 | * Fixing [issues](https://github.com/roots/roots/issues) 719 | 720 | ## Changelog 721 | 722 | ### Version 4.2.14 723 | * Fixing flickering (on -webkit) when used background-image to instead of 724 | * FIX calling API method stopAuto() 725 | * InvalidPointerId on Android 6 726 | * Use jQuery.fn.on instead of jQuery.fn.bind #1126 727 | * InvalidPointerId on Android 6 728 | 729 | ### Version 4.2.13 730 | * Fix error pagerqty 731 | * Fix the problem #48 in the version 4.2.5 when using YUI Compressor 732 | * Fix division by 0 733 | * Ensure that slider.working is set to false at the end of goToSlide(), regardless of what happened with position. 734 | * Add Callback for when Auto changes... 735 | * Fix for Firefox59 and PointerEvent standard compatibility 736 | * Fix for middle mouse click 737 | * Fix typo 738 | * Format the license in package.json to match the SPDX standard 739 | * Code formatting 740 | 741 | ### Version 4.2.12 742 | * Fixes auto control theme 743 | 744 | ### Version 4.2.11 745 | * Removes auto-centering for sliders with no pager or controls 746 | 747 | ### Version 4.2.10 748 | * Bumps npm and bower versions 749 | 750 | ### Version 4.2.9 751 | * Removes node engine version requirement 752 | 753 | ### Version 4.2.8 754 | * Removes auto-centering from the theme file (`jquery.bxslider.css`) 755 | 756 | ### Version 4.2.7 757 | * Allows new version to be published to NPM 758 | 759 | ### Version 4.2.6 760 | * Fix: jQuery 3 support 761 | * Adds Gulp and removes Grunt (for easier local development) 762 | 763 | ### Version 4.2.5 764 | * Fix: Vertical carousel minSlides not working #840 765 | * Fix: slider breaks with css animations if settings.speed set to 0 #838 766 | * Fix: Slider runs into undefined state when reloadSlider is called before initialization was finished #833 767 | 768 | ### Version 4.2.4 769 | 770 | NOTICE: We have switched to a Grunt based build process in order to leverage [Assemble](http://assemble.io) for local documentation building. Please review the above notes about Grunt for the commands available. 771 | 772 | * Fix: Fixed transition from first to last slide during infinite loop #778 773 | * Fix: Reload on multiple sliders doesn't work? #755 774 | * Fix: bxSlider with text only #746 775 | * Fix: bower missing main and ignore entries #738 776 | * Fix: Tickermode transitionend event bubbling #737 777 | * Fix: Initializing before destroyed breaks slider #748 778 | * Enhancement: Added shrinkItems carousel setting #772 779 | * Enhancement: Maintain auto display of slides after a manual selection #594 780 | * Enhancement: Slider getter through jquery object #739 781 | * Enhancement: Add aria attributes #751 782 | * Enhancement: Slider element in every callback and a new method getSliderElement (#780) 783 | * Enhancement: Local Documentiation and examples. I have added buildable documentation to the repo. This will expand over time and allow for community corrections as needed. Please see above Grunt notes on how to build. 784 | 785 | 786 | ### Version 4.2.3 787 | * Minor bug fix 788 | 789 | ### Version 4.2.2 790 | * Fix: Remove unused plugin variable (#733) 791 | * Fix: `updateAfterSlideTransition` not being called (#704) 792 | * Fix: Slider stops auto advancing (#702) 793 | * Fix: Refresh page, slider show the last item at the first in mode: 'horizontal' (#694) 794 | * Fix: horizintal ticker stutters on loop (#669) 795 | * Fix: Wrong bx-wrapper bottom margin with controls=true and pager=false (#647) 796 | * Fix: add css tickerHover. (#629) 797 | * Fix: Slider refusing to scale down, only up (#611) 798 | * Fix: bxSlider freezes on touch devices (#540) 799 | * Fix: Multiple fixes and improvements for Windows Mobile Devices (#596) 800 | * Fix: Accessing bxslider's slider object inside its “onSliderLoad” callback returns undefined (#475) 801 | * Fix: infiniteLoop glitch when scrolling from first to last slide (#429) 802 | * Enhancement: Cancel transitions on callbacks by returning false. (#411) 803 | * Enhancement: Added Keyboard arrow left and right support (#239) 804 | 805 | ### Version 4.2.1 806 | * Fix: Merge Conflict in dist 807 | * Fix: modified bower.json 808 | 809 | ### Version 4.2.0 810 | * Fix: Reverse #714, fixes #722. 811 | * Fix: Repo Tag #729 812 | * Fix: #720 pagerCustom issues 813 | 814 | 4.2.0 Introduces a streamlined build process using [gulp](www.gulpjs.com). Along with this new build process the projects folder structure has been changed. You will find a `dist` folder with all assets ready to use, including both minified and unminified versions of the javascript. These assets should be ready to go. In `src` you will find the uncompiled assets, including a new less version of the css for bxslider. This is an important step for bxslider. It will help speed development up and keep work clean. It also paves the way for a big revamp we have planned in the future. 815 | 816 | **Unfamiliar with npm? Don't have node installed?** [Download and install node.js](http://nodejs.org/download/) before proceeding. 817 | 818 | From the command line: 819 | 820 | 1. Install [gulp](http://gulpjs.com) globally with `npm install -g gulp` 821 | 2. Navigate to the project directory, then run `npm install` 822 | 823 | You now have all the necessary dependencies to run the build process. 824 | 825 | ### Available gulp commands 826 | 827 | * `gulp` — Compile and optimize all files to `dist` 828 | * `gulp styles` — Compile css assets only to `dist` 829 | * `gulp scripts` — Compile js assets only to `dist` 830 | * `gulp images` - Run lossless compression on all the images and copy to `dist` 831 | * `gulp jshint` — Checks JS and JSON code for errors based on our .jshintrc settings 832 | 833 | 834 | ### Version 4.1.3 835 | * Fix: responsive issue for horizontal mode for issue #611, #714 836 | * Fix: extra space on the left when using fade mode. #715 837 | * Fix: wrongly removing custom pager in destroySlider #610 838 | * Fix: bug with reloading slider with custom pager #545 839 | * Fix: Issue with infinite scroll sometimes returning to 0 #481 840 | * Fix: When "infiniteLoop" is used, true is not passed to a clone method. #346 841 | * Fix: "pagerCustom" won't work when using reloadSlider #171 842 | * Fix: Remove vendor prefix for translateZ(0) #565 843 | * Fix: give styles on focus for accessibility #228 844 | * Fix: Minified Version out of sync. 845 | * Fix: Remove -5px left #517 846 | * Enhancement: Invert order call of appendControls() and appendPager() #226 847 | * Enhancement: Various Indentation and typos in docs fixed. #551, #578 848 | * Enhancement: Update jsDelivr with update.json for autoupdate of CDN 849 | * Enhancement: Tag Repo so it can be included in CDNJS 850 | * Created development branch to work from. Eventually will restructure entire repo to follow best practice setup. 851 | 852 | 853 | ### Version 4.1.2 854 | * Added `bower.json` configuration file. Manage bxSlider as a dependency using [bower](http://bower.io/). 855 | 856 | ### Version 4.1.1 857 | * Removed imagesLoaded library and added iframe preloading support 858 | * Added responsive option - setting to false will prevent $(window).resize binding 859 | 860 | ### Version 4.1 861 | * Carousel mode (minSlides / maxSlides) was re-written to be more intuitive. 862 | * SlideWidth now acts as it should (slides respect the width value). 863 | * SlideWidth now properly parsed: accepts string ("600px") or integer (600). 864 | * Slider now only needs to load visible slides (by default) in order to initialize which results in much faster loading. A "preloadImages" setting allows for configuration. 865 | 866 | 867 | Long live Zep. 868 | -------------------------------------------------------------------------------- /src/css/jquery.bxslider.css: -------------------------------------------------------------------------------- 1 | /** VARIABLES 2 | ===================================*/ 3 | /** RESET AND LAYOUT 4 | ===================================*/ 5 | .bx-wrapper { 6 | position: relative; 7 | margin-bottom: 60px; 8 | padding: 0; 9 | *zoom: 1; 10 | -ms-touch-action: pan-y; 11 | touch-action: pan-y; 12 | } 13 | .bx-wrapper img { 14 | max-width: 100%; 15 | display: block; 16 | } 17 | .bxslider { 18 | margin: 0; 19 | padding: 0; 20 | /*fix flickering when used background-image instead of (on Chrome)*/ 21 | -webkit-perspective: 1000; 22 | } 23 | ul.bxslider { 24 | list-style: none; 25 | } 26 | .bx-viewport { 27 | /* fix other elements on the page moving (in Chrome) */ 28 | -webkit-transform: translateZ(0); 29 | } 30 | /** THEME 31 | ===================================*/ 32 | .bx-wrapper { 33 | -moz-box-shadow: 0 0 5px #ccc; 34 | -webkit-box-shadow: 0 0 5px #ccc; 35 | box-shadow: 0 0 5px #ccc; 36 | border: 5px solid #fff; 37 | background: #fff; 38 | } 39 | .bx-wrapper .bx-pager, 40 | .bx-wrapper .bx-controls-auto { 41 | position: absolute; 42 | bottom: -30px; 43 | width: 100%; 44 | } 45 | /* LOADER */ 46 | .bx-wrapper .bx-loading { 47 | min-height: 50px; 48 | background: url('images/bx_loader.gif') center center no-repeat #ffffff; 49 | height: 100%; 50 | width: 100%; 51 | position: absolute; 52 | top: 0; 53 | left: 0; 54 | z-index: 2000; 55 | } 56 | /* PAGER */ 57 | .bx-wrapper .bx-pager { 58 | text-align: center; 59 | font-size: .85em; 60 | font-family: Arial; 61 | font-weight: bold; 62 | color: #666; 63 | padding-top: 20px; 64 | } 65 | .bx-wrapper .bx-pager.bx-default-pager a { 66 | background: #666; 67 | text-indent: -9999px; 68 | display: block; 69 | width: 10px; 70 | height: 10px; 71 | margin: 0 5px; 72 | outline: 0; 73 | -moz-border-radius: 5px; 74 | -webkit-border-radius: 5px; 75 | border-radius: 5px; 76 | } 77 | .bx-wrapper .bx-pager.bx-default-pager a:hover, 78 | .bx-wrapper .bx-pager.bx-default-pager a.active, 79 | .bx-wrapper .bx-pager.bx-default-pager a:focus { 80 | background: #000; 81 | } 82 | .bx-wrapper .bx-pager-item, 83 | .bx-wrapper .bx-controls-auto .bx-controls-auto-item { 84 | display: inline-block; 85 | vertical-align: bottom; 86 | *zoom: 1; 87 | *display: inline; 88 | } 89 | .bx-wrapper .bx-pager-item { 90 | font-size: 0; 91 | line-height: 0; 92 | } 93 | /* DIRECTION CONTROLS (NEXT / PREV) */ 94 | .bx-wrapper .bx-prev { 95 | left: 10px; 96 | background: url('images/controls.png') no-repeat 0 -32px; 97 | } 98 | .bx-wrapper .bx-prev:hover, 99 | .bx-wrapper .bx-prev:focus { 100 | background-position: 0 0; 101 | } 102 | .bx-wrapper .bx-next { 103 | right: 10px; 104 | background: url('images/controls.png') no-repeat -43px -32px; 105 | } 106 | .bx-wrapper .bx-next:hover, 107 | .bx-wrapper .bx-next:focus { 108 | background-position: -43px 0; 109 | } 110 | .bx-wrapper .bx-controls-direction a { 111 | position: absolute; 112 | top: 50%; 113 | margin-top: -16px; 114 | outline: 0; 115 | width: 32px; 116 | height: 32px; 117 | text-indent: -9999px; 118 | z-index: 9999; 119 | } 120 | .bx-wrapper .bx-controls-direction a.disabled { 121 | display: none; 122 | } 123 | /* AUTO CONTROLS (START / STOP) */ 124 | .bx-wrapper .bx-controls-auto { 125 | text-align: center; 126 | } 127 | .bx-wrapper .bx-controls-auto .bx-start { 128 | display: block; 129 | text-indent: -9999px; 130 | width: 10px; 131 | height: 11px; 132 | outline: 0; 133 | background: url('images/controls.png') -86px -11px no-repeat; 134 | margin: 0 3px; 135 | } 136 | .bx-wrapper .bx-controls-auto .bx-start:hover, 137 | .bx-wrapper .bx-controls-auto .bx-start.active, 138 | .bx-wrapper .bx-controls-auto .bx-start:focus { 139 | background-position: -86px 0; 140 | } 141 | .bx-wrapper .bx-controls-auto .bx-stop { 142 | display: block; 143 | text-indent: -9999px; 144 | width: 9px; 145 | height: 11px; 146 | outline: 0; 147 | background: url('images/controls.png') -86px -44px no-repeat; 148 | margin: 0 3px; 149 | } 150 | .bx-wrapper .bx-controls-auto .bx-stop:hover, 151 | .bx-wrapper .bx-controls-auto .bx-stop.active, 152 | .bx-wrapper .bx-controls-auto .bx-stop:focus { 153 | background-position: -86px -33px; 154 | } 155 | /* PAGER WITH AUTO-CONTROLS HYBRID LAYOUT */ 156 | .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-pager { 157 | text-align: left; 158 | width: 80%; 159 | } 160 | .bx-wrapper .bx-controls.bx-has-controls-auto.bx-has-pager .bx-controls-auto { 161 | right: 0; 162 | width: 35px; 163 | } 164 | /* IMAGE CAPTIONS */ 165 | .bx-wrapper .bx-caption { 166 | position: absolute; 167 | bottom: 0; 168 | left: 0; 169 | background: #666; 170 | background: rgba(80, 80, 80, 0.75); 171 | width: 100%; 172 | } 173 | .bx-wrapper .bx-caption span { 174 | color: #fff; 175 | font-family: Arial; 176 | display: block; 177 | font-size: .85em; 178 | padding: 10px; 179 | } 180 | -------------------------------------------------------------------------------- /src/images/bx_loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenwanderski/bxslider-4/ed3ac54d1d3c1ae823689f614235955f5ae54fe4/src/images/bx_loader.gif -------------------------------------------------------------------------------- /src/images/controls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stevenwanderski/bxslider-4/ed3ac54d1d3c1ae823689f614235955f5ae54fe4/src/images/controls.png -------------------------------------------------------------------------------- /src/vendor/jquery.easing.1.3.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - jQuery Easing 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2008 George McGinley Smith 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 17 | * Redistributions of source code must retain the above copyright notice, this list of 18 | * conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright notice, this list 20 | * of conditions and the following disclaimer in the documentation and/or other materials 21 | * provided with the distribution. 22 | * 23 | * Neither the name of the author nor the names of contributors may be used to endorse 24 | * or promote products derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 27 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 29 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 30 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 31 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 32 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 34 | * OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // t: current time, b: begInnIng value, c: change In value, d: duration 39 | jQuery.easing['jswing'] = jQuery.easing['swing']; 40 | 41 | jQuery.extend( jQuery.easing, 42 | { 43 | def: 'easeOutQuad', 44 | swing: function (x, t, b, c, d) { 45 | //alert(jQuery.easing.default); 46 | return jQuery.easing[jQuery.easing.def](x, t, b, c, d); 47 | }, 48 | easeInQuad: function (x, t, b, c, d) { 49 | return c*(t/=d)*t + b; 50 | }, 51 | easeOutQuad: function (x, t, b, c, d) { 52 | return -c *(t/=d)*(t-2) + b; 53 | }, 54 | easeInOutQuad: function (x, t, b, c, d) { 55 | if ((t/=d/2) < 1) return c/2*t*t + b; 56 | return -c/2 * ((--t)*(t-2) - 1) + b; 57 | }, 58 | easeInCubic: function (x, t, b, c, d) { 59 | return c*(t/=d)*t*t + b; 60 | }, 61 | easeOutCubic: function (x, t, b, c, d) { 62 | return c*((t=t/d-1)*t*t + 1) + b; 63 | }, 64 | easeInOutCubic: function (x, t, b, c, d) { 65 | if ((t/=d/2) < 1) return c/2*t*t*t + b; 66 | return c/2*((t-=2)*t*t + 2) + b; 67 | }, 68 | easeInQuart: function (x, t, b, c, d) { 69 | return c*(t/=d)*t*t*t + b; 70 | }, 71 | easeOutQuart: function (x, t, b, c, d) { 72 | return -c * ((t=t/d-1)*t*t*t - 1) + b; 73 | }, 74 | easeInOutQuart: function (x, t, b, c, d) { 75 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 76 | return -c/2 * ((t-=2)*t*t*t - 2) + b; 77 | }, 78 | easeInQuint: function (x, t, b, c, d) { 79 | return c*(t/=d)*t*t*t*t + b; 80 | }, 81 | easeOutQuint: function (x, t, b, c, d) { 82 | return c*((t=t/d-1)*t*t*t*t + 1) + b; 83 | }, 84 | easeInOutQuint: function (x, t, b, c, d) { 85 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 86 | return c/2*((t-=2)*t*t*t*t + 2) + b; 87 | }, 88 | easeInSine: function (x, t, b, c, d) { 89 | return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 90 | }, 91 | easeOutSine: function (x, t, b, c, d) { 92 | return c * Math.sin(t/d * (Math.PI/2)) + b; 93 | }, 94 | easeInOutSine: function (x, t, b, c, d) { 95 | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 96 | }, 97 | easeInExpo: function (x, t, b, c, d) { 98 | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 99 | }, 100 | easeOutExpo: function (x, t, b, c, d) { 101 | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 102 | }, 103 | easeInOutExpo: function (x, t, b, c, d) { 104 | if (t==0) return b; 105 | if (t==d) return b+c; 106 | if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 107 | return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 108 | }, 109 | easeInCirc: function (x, t, b, c, d) { 110 | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 111 | }, 112 | easeOutCirc: function (x, t, b, c, d) { 113 | return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 114 | }, 115 | easeInOutCirc: function (x, t, b, c, d) { 116 | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 117 | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 118 | }, 119 | easeInElastic: function (x, t, b, c, d) { 120 | var s=1.70158;var p=0;var a=c; 121 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 122 | if (a < Math.abs(c)) { a=c; var s=p/4; } 123 | else var s = p/(2*Math.PI) * Math.asin (c/a); 124 | return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 125 | }, 126 | easeOutElastic: function (x, t, b, c, d) { 127 | var s=1.70158;var p=0;var a=c; 128 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 129 | if (a < Math.abs(c)) { a=c; var s=p/4; } 130 | else var s = p/(2*Math.PI) * Math.asin (c/a); 131 | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 132 | }, 133 | easeInOutElastic: function (x, t, b, c, d) { 134 | var s=1.70158;var p=0;var a=c; 135 | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 136 | if (a < Math.abs(c)) { a=c; var s=p/4; } 137 | else var s = p/(2*Math.PI) * Math.asin (c/a); 138 | if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 139 | return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 140 | }, 141 | easeInBack: function (x, t, b, c, d, s) { 142 | if (s == undefined) s = 1.70158; 143 | return c*(t/=d)*t*((s+1)*t - s) + b; 144 | }, 145 | easeOutBack: function (x, t, b, c, d, s) { 146 | if (s == undefined) s = 1.70158; 147 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 148 | }, 149 | easeInOutBack: function (x, t, b, c, d, s) { 150 | if (s == undefined) s = 1.70158; 151 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 152 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 153 | }, 154 | easeInBounce: function (x, t, b, c, d) { 155 | return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 156 | }, 157 | easeOutBounce: function (x, t, b, c, d) { 158 | if ((t/=d) < (1/2.75)) { 159 | return c*(7.5625*t*t) + b; 160 | } else if (t < (2/2.75)) { 161 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 162 | } else if (t < (2.5/2.75)) { 163 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 164 | } else { 165 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 166 | } 167 | }, 168 | easeInOutBounce: function (x, t, b, c, d) { 169 | if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 170 | return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 171 | } 172 | }); 173 | 174 | /* 175 | * 176 | * TERMS OF USE - EASING EQUATIONS 177 | * 178 | * Open source under the BSD License. 179 | * 180 | * Copyright © 2001 Robert Penner 181 | * All rights reserved. 182 | * 183 | * Redistribution and use in source and binary forms, with or without modification, 184 | * are permitted provided that the following conditions are met: 185 | * 186 | * Redistributions of source code must retain the above copyright notice, this list of 187 | * conditions and the following disclaimer. 188 | * Redistributions in binary form must reproduce the above copyright notice, this list 189 | * of conditions and the following disclaimer in the documentation and/or other materials 190 | * provided with the distribution. 191 | * 192 | * Neither the name of the author nor the names of contributors may be used to endorse 193 | * or promote products derived from this software without specific prior written permission. 194 | * 195 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 196 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 197 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 198 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 199 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 200 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 201 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 202 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 203 | * OF THE POSSIBILITY OF SUCH DAMAGE. 204 | * 205 | */ -------------------------------------------------------------------------------- /src/vendor/jquery.fitvids.js: -------------------------------------------------------------------------------- 1 | /*global jQuery */ 2 | /*jshint multistr:true browser:true */ 3 | /*! 4 | * FitVids 1.0 5 | * 6 | * Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 7 | * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 8 | * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 9 | * 10 | * Date: Thu Sept 01 18:00:00 2011 -0500 11 | */ 12 | 13 | (function( $ ){ 14 | 15 | "use strict"; 16 | 17 | $.fn.fitVids = function( options ) { 18 | var settings = { 19 | customSelector: null 20 | }; 21 | 22 | var div = document.createElement('div'), 23 | ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; 24 | 25 | div.className = 'fit-vids-style'; 26 | div.innerHTML = '­'; 43 | 44 | ref.parentNode.insertBefore(div,ref); 45 | 46 | if ( options ) { 47 | $.extend( settings, options ); 48 | } 49 | 50 | return this.each(function(){ 51 | var selectors = [ 52 | "iframe[src*='player.vimeo.com']", 53 | "iframe[src*='www.youtube.com']", 54 | "iframe[src*='www.kickstarter.com']", 55 | "object", 56 | "embed" 57 | ]; 58 | 59 | if (settings.customSelector) { 60 | selectors.push(settings.customSelector); 61 | } 62 | 63 | var $allVideos = $(this).find(selectors.join(',')); 64 | 65 | $allVideos.each(function(){ 66 | var $this = $(this); 67 | if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } 68 | var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), 69 | width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), 70 | aspectRatio = height / width; 71 | if(!$this.attr('id')){ 72 | var videoID = 'fitvid' + Math.floor(Math.random()*999999); 73 | $this.attr('id', videoID); 74 | } 75 | $this.wrap('
          ').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); 76 | $this.removeAttr('height').removeAttr('width'); 77 | }); 78 | }); 79 | }; 80 | })( jQuery ); 81 | --------------------------------------------------------------------------------