Jump to content
Search Community

jacopomoretto

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by jacopomoretto

  1. Hi to all,

    I forget to post a simple test

    Code until v1.9.6

    function test(target)
    {
    var isSelector = (target.jquery || (typeof(target.each) === "function" && target[0] && target[0].nodeType && target[0].style));
    return isSelector;
    }
    test(window);
    

    Code from v1.9.7

    function test(target)
    {
        var isSelector = (target.jquery || (target.length && target[0] && target[0].nodeType && target[0].style && !target.nodeType));
        return isSelector;
    }
    test(window);
    

    If you test these two different function in the console in this same page (that have 6 iframes in it) you can view the issue.

    Of course you can also test the functions with the example above, because youtube has nothing to do with the bug

     

    Best Regards

    Jacopo

    • Like 1
  2. Hi Rodrigo,

    thanks for the answer and the solution, but I think that we have found a bug in the new solution ideated to differentiate if the first argument is a selector or an js object.

    Therefore the problem presents itself if you pass "window" as argument to a tweenlite declaration and there are some iframes in the page.

     

    This is the functioning line of code (until v 1.9.6):

    var isSelector = (target.jquery || (typeof(target.each) === "function" && target[0] && target[0].nodeType && target[0].style)),
    

    This is the incriminated line of code (starting from v 1.9.7):

    var isSelector = (target.jquery || (target.length && target[0] && target[0].nodeType && target[0].style && !target.nodeType)),
    

    Here if you pass window as target to the TweenLite function and there are iframe you get that:

    1) target[0] is the first iframe of the page and not the top window

    2) its impossible to get nodeType property for cross domain issue

     

    One ease and rough solution is:

    var isSelector = target == window ? false : (target.jquery || (target.length && target[0] && target[0].nodeType && target[0].style && !target.nodeType)),
    

    So the problem is in the new solution adopted to detect the object involved in the animation.

     

    Thank you

×
×
  • Create New...