Skip to content

Commit

Permalink
[BUGFIX] fix issue with parallax plugin not showing on mobile devices…
Browse files Browse the repository at this point in the history
…,IE,Edge (#476)
  • Loading branch information
mesosa authored and dmh committed Feb 7, 2019
1 parent c008996 commit 5ae78ef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
31 changes: 25 additions & 6 deletions felayout_t3kit/dev/js/main/contentElements/parallax.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,51 @@
;(function ($) {
'use strict'

// document load event
// document load event
$(document).ready(function () {
// Parallax
// https://github.com/nk-o/jarallax
if (!$('html').hasClass('IE')) { // disabled in IE since scrolling looks jerky
if (!$('html').hasClass('IE')) { // if the browser is not IE
$('.parallax-img').jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
disableParallax: /iPad|iPhone|iPod|Edge/ // disable Ios and Microsoft Edge
speed: 0.5
})
$('.parallax-resimg').each(function () {
$(this).jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
disableParallax: /iPad|iPhone|iPod|Edge/, // disable Ios and Microsoft Edge
imgSrc: $(this).css('background-image').match(/\(([^)]+)\)/)[1].replace(/"/g, '')
})
})
$('.parallax-video').each(function () {
$(this).jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
disableParallax: /iPad|iPhone|iPod|Android/, // disable Ios and Android
videoSrc: $(this).attr('data-video-url')
})
})
} else { //disabled parallax in IE since scrolling looks jerky
$('.parallax-img').jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
disableParallax: /IE/
})
$('.parallax-resimg').each(function () {
$(this).jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
imgSrc: $(this).css('background-image').match(/\(([^)]+)\)/)[1].replace(/"/g, ''),
disableParallax: /IE/
})
})
$('.parallax-video').each(function () {
$(this).jarallax({
type: 'scroll', // scroll, scale, opacity, scroll-opacity, scale-opacity
speed: 0.5,
videoSrc: $(this).attr('data-video-url'),
disableParallax: /IE/
})
})
}
})
})(jQuery)
2 changes: 1 addition & 1 deletion felayout_t3kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"awesomplete": "1.1.2",
"bootstrap": "3.3.7",
"flag-icon-css": "3.0.0",
"jarallax": "1.10.3",
"jarallax": "1.10.7",
"jquery": "3.3.1",
"jquery-touchswipe": "1.6.18",
"object-fit-images": "3.2.3",
Expand Down

0 comments on commit 5ae78ef

Please sign in to comment.