Skip to content

Commit 5ae78ef

Browse files
mesosadmh
authored andcommitted
[BUGFIX] fix issue with parallax plugin not showing on mobile devices,IE,Edge (#476)
1 parent c008996 commit 5ae78ef

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

felayout_t3kit/dev/js/main/contentElements/parallax.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,51 @@
33
;(function ($) {
44
'use strict'
55

6-
// document load event
6+
// document load event
77
$(document).ready(function () {
88
// Parallax
99
// 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
1111
$('.parallax-img').jarallax({
1212
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
1514
})
1615
$('.parallax-resimg').each(function () {
1716
$(this).jarallax({
1817
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
1918
speed: 0.5,
20-
disableParallax: /iPad|iPhone|iPod|Edge/, // disable Ios and Microsoft Edge
2119
imgSrc: $(this).css('background-image').match(/\(([^)]+)\)/)[1].replace(/"/g, '')
2220
})
2321
})
2422
$('.parallax-video').each(function () {
2523
$(this).jarallax({
2624
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
2725
speed: 0.5,
28-
disableParallax: /iPad|iPhone|iPod|Android/, // disable Ios and Android
2926
videoSrc: $(this).attr('data-video-url')
3027
})
3128
})
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+
})
3251
}
3352
})
3453
})(jQuery)

felayout_t3kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"awesomplete": "1.1.2",
1212
"bootstrap": "3.3.7",
1313
"flag-icon-css": "3.0.0",
14-
"jarallax": "1.10.3",
14+
"jarallax": "1.10.7",
1515
"jquery": "3.3.1",
1616
"jquery-touchswipe": "1.6.18",
1717
"object-fit-images": "3.2.3",

0 commit comments

Comments
 (0)