Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Jquery scrollTop/scrollLeft works but not animate

I have a set sized iframe within a larger sized HTML document, which makes it so it has a scrollbar. There is another set of iframe just like the first one and I wanted to synchronise the scrolling on both document. I can get both #document, which has the scrollbar. So I can set the scroll event. The issue is I would like to use .animate, but when I do I get the following error.

> jquery-3.6.0.min.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'display')
>     at ae (jquery-3.6.0.min.js:2:44259)
>     at Object.S.Animation.S.extend.prefilters (jquery-3.6.0.min.js:2:73843)
>     at lt (jquery-3.6.0.min.js:2:73011)
>     at HTMLDocument.a (jquery-3.6.0.min.js:2:76247)
>     at Function.dequeue (jquery-3.6.0.min.js:2:42775)
>     at HTMLDocument.<anonymous> (jquery-3.6.0.min.js:2:43330)
>     at Function.each (jquery-3.6.0.min.js:2:3639)
>     at S.fn.init.each (jquery-3.6.0.min.js:2:1778)
>     at S.fn.init.queue (jquery-3.6.0.min.js:2:43217)
>     at S.fn.init.animate (jquery-3.6.0.min.js:2:76386)

First of all I do not understand what is missing and if .animate does not work why does .scrollTop() and .scrollLeft() work?

I use the following code to .animate and .scrollTop()/.scrollLeft()

htmlContentSrc.scroll(function (event) {
                if (previewLangPairMngr.onScrollBlocker && previewDisplayMngr.containerSync) {
                    previewLangPairMngr.onScrollBlocker = false;
                    htmlContentTrg.animate({
                        scrollTop: htmlContentSrc.scrollTop(),
                        scrollLeft: htmlContentSrc.scrollLeft()
                    }, 100, function () {
                            previewLangPairMngr.onScrollBlocker = true;
                    });
                }
            });
htmlContentSrc.scroll(function (event) {
                if (previewLangPairMngr.onScrollBlocker && previewDisplayMngr.containerSync) {
                    previewLangPairMngr.onScrollBlocker = false;
                    htmlContentTrg.scrollTop(htmlContentSrc.scrollTop());
                    htmlContentTrg.scrollLeft(htmlContentSrc.scrollLeft());
                    previewLangPairMngr.onScrollBlocker = true;
                }
            });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!