|
3 | 3 | ;(function ($) { |
4 | 4 | 'use strict' |
5 | 5 |
|
6 | | - // document load event |
| 6 | + // document load event |
7 | 7 | $(document).ready(function () { |
8 | 8 | // Parallax |
9 | 9 | // https://github.com/nk-o/jarallax |
10 | | - if (!$('html').hasClass('IE')) { // disabled in IE since scrolling looks jerky |
| 10 | + if (!$('html').hasClass('IE')) { // if the browser is not IE |
11 | 11 | $('.parallax-img').jarallax({ |
12 | 12 | type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
13 | | - speed: 0.5, |
14 | | - disableParallax: /iPad|iPhone|iPod|Edge/ // disable Ios and Microsoft Edge |
| 13 | + speed: 0.5 |
15 | 14 | }) |
16 | 15 | $('.parallax-resimg').each(function () { |
17 | 16 | $(this).jarallax({ |
18 | 17 | type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
19 | 18 | speed: 0.5, |
20 | | - disableParallax: /iPad|iPhone|iPod|Edge/, // disable Ios and Microsoft Edge |
21 | 19 | imgSrc: $(this).css('background-image').match(/\(([^)]+)\)/)[1].replace(/"/g, '') |
22 | 20 | }) |
23 | 21 | }) |
24 | 22 | $('.parallax-video').each(function () { |
25 | 23 | $(this).jarallax({ |
26 | 24 | type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
27 | 25 | speed: 0.5, |
28 | | - disableParallax: /iPad|iPhone|iPod|Android/, // disable Ios and Android |
29 | 26 | videoSrc: $(this).attr('data-video-url') |
30 | 27 | }) |
31 | 28 | }) |
| 29 | + } else { //disabled parallax in IE since scrolling looks jerky |
| 30 | + $('.parallax-img').jarallax({ |
| 31 | + type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
| 32 | + speed: 0.5, |
| 33 | + disableParallax: /IE/ |
| 34 | + }) |
| 35 | + $('.parallax-resimg').each(function () { |
| 36 | + $(this).jarallax({ |
| 37 | + type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
| 38 | + speed: 0.5, |
| 39 | + imgSrc: $(this).css('background-image').match(/\(([^)]+)\)/)[1].replace(/"/g, ''), |
| 40 | + disableParallax: /IE/ |
| 41 | + }) |
| 42 | + }) |
| 43 | + $('.parallax-video').each(function () { |
| 44 | + $(this).jarallax({ |
| 45 | + type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity |
| 46 | + speed: 0.5, |
| 47 | + videoSrc: $(this).attr('data-video-url'), |
| 48 | + disableParallax: /IE/ |
| 49 | + }) |
| 50 | + }) |
32 | 51 | } |
33 | 52 | }) |
34 | 53 | })(jQuery) |
0 commit comments