Jump to content
Search Community

BBaysinger

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by BBaysinger

  1. It doesn't set everything immediately if you pass a position. I need it to have all the same features, onComplete, etc., as a timeline. I didn't have it in there, but the wrapper function will return the timeline instance for inclusion into other timelines, etc...

     

    So I just need a timeline that (can) immediately set the 'from' properties and function just like any other timeline.

     

     

  2. I was trying to create a function that was the inverse of TimelineLite.set(), as from() is the inverse of to(). So a set() function that starts the property at the passed value, then swaps back to the initial value. I wrapped TimelineLite from() to achieve this with a time of zero:

     

    function unset(selector, props, position) {
        // Does not work.
        new TimelineLite().from(selector, 0, props, position);
    };

     

    TimelineLite.from() does not work if time is less than 0.0000003.

     

    So remedied this with:

     

    function unset(selector, props, position) {
        // Does not work if duration < 0.0000003.
        new TimelineMax().from(selector, 0.0000003, props, position);
    };

     

    Is 0.0000003 some sort of magic number? Is this expected behavior? Is there a function that already does what I want?

     

    I was testing in Chrome on OSX.

  3. Sorry folks. I'm pretty new to Webpack, but trying to figure this out. I haven't used 'resolve' in config until now, and it's not working for me the way I think you're explaining. I'm importing like so:

    import ScrollToPlugin from 'ScrollToPlugin';
    import TweenLite from 'TweenLite';

     

    And in webpack.config.js I have:

     

      resolve: {
        root: path.resolve(__dirname),
        extensions: ['', '.js'],
        alias: {
          TweenLite: "gsap/src/uncompressed/TweenLite",
          ScrollToPlugin: 'gsap/src/uncompressed/plugins/ScrollToPlugin'
        }
      }
     
     

    Neither import works. I get:

    ERROR in ./js/components/layout/HeaderMain.js
    Module not found: Error: Cannot resolve module 'ScrollToPlugin' in /Library/WebServer/Documents/bb_site_2/js/components/layout
     @ ./js/components/layout/HeaderMain.js 22:22-47
    
    ERROR in ./js/components/layout/HeaderMain.js
    Module not found: Error: Cannot resolve module 'TweenLite' in /Library/WebServer/Documents/bb_site_2/js/components/layout
     @ ./js/components/layout/HeaderMain.js 26:17-37

    What's odd to me is that if I change the alias paths to something that's complete garbage, Webpack doesn't complain about it. It's like my resolve object is being ignored. Shouldn't it give me an error about that?

×
×
  • Create New...