Code Monkey home page Code Monkey logo

Comments (11)

nk-o avatar nk-o commented on June 5, 2024 2

I think this is possible only with custom attribute for videos instead of [data-jarallax-video].

<div class="jarallax" data-my-bg-video="https://youtube..."></div>
if(!(navigator.userAgent.indexOf('MSIE')!==-1 || navigator.appVersion.indexOf('Trident/') > 0)) {
    $('.jarallax').each(function () {
        $(this).jarallax({
            videoSrc: $(this).attr('data-my-bg-video')
        });
    });
}

from jarallax.

nk-o avatar nk-o commented on June 5, 2024 1

Oh, just found a bug. Video parallax will not work properly with enableTransform: false. Will be fixed today. Thank you.

from jarallax.

nk-o avatar nk-o commented on June 5, 2024

Hi, hello0robot.

I checked solutions, but nothing works. I think the only way - stop using translate3d (use translate, translateX, translateY instead) + disable transform parallax for IE 11 and lower.

Try this code:

$('.parallax').jarallax({
    enableTransform: !(navigator.userAgent.indexOf('MSIE')!==-1 || navigator.appVersion.indexOf('Trident/') > 0)
});

Best regards, nK.

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

As for now I'm checking browser with userAgent and disabled jarallax completely for IE:

  /**
   * Detect IE
   */

  function is_IE() {

    var ua = window.navigator.userAgent;

    var msie = ua.indexOf('MSIE ');
    var trident = ua.indexOf('Trident/');

    if (msie > 0 || trident > 0) {
      return true;
    } else {
      return false;
    }

  }

  /**
   * Parallax
   */

  if(!is_IE()) {
    $('.parallax-video').jarallax();
  }

Your solution with enableTransform looks nicer though. Will it work with video backgrounds?

from jarallax.

nk-o avatar nk-o commented on June 5, 2024

Try 1.7.1 version. Video parallax with enableTransform: false should work now.

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

Sorry, I've been a little bit busy recently. Will check asap and get back to you. Thanks!

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

OK, I've just tested.

It seems to do the job and disable 3d transforms. However it looks really jerky in IE, so I disabled it completely like here: #17 (comment)

However there's a new bug, that doesn't prevent videos from loading, even if I don't init jarallax via jQuery. I suppose it takes data attributes instead from HTML and loads jarallax by itself.

It wasn't an issue in 1.7.0, so I'd rather revert to it as for now.

from jarallax.

nk-o avatar nk-o commented on June 5, 2024

Since version 1.7.1 Jarallax automatically initialized on elements with attribute [data-jarallax-video]. Some of users requested that behavior and I agree with them.

Changed line - https://github.com/nk-o/jarallax/blob/master/jarallax/jarallax.js#L704

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

Yes, it's fine.

But how can I disable Jarallax completely in IE, including videos then?

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

That's a pity. Thanks anyway.

from jarallax.

hellor0bot avatar hellor0bot commented on June 5, 2024

Did it the way you suggested. It's all good.

Thanks a lot!

from jarallax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.