Uncaught error no element is specified to initialize perfectscrollbar

Assuming you have a button with the id button, try this example:

Assuming you have a button with the id button, try this example:

$("#button").click(function() {
    $([document.documentElement, document.body]).animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});

I got the code from the article Smoothly scroll to an element without a jQuery plugin. And I have tested it on the example below.

<html>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script>
        $(document).ready(function (){
            $("#click").click(function (){
                $('html, body').animate({
                    scrollTop: $("#div1").offset().top
                }, 2000);
            });
        });
    </script>
    <div id="div1" style="height: 1000px; width 100px">
        Test
    </div>
    <br/>
    <div id="div2" style="height: 1000px; width 100px">
        Test 2
    </div>
    <button id="click">Click me</button>
</html>

Your version of Eclipse is 64-bit, based on the paths and filenames.
However, the version of Java that it’s picking up is 32-bit, as indicated by where it is coming from, on this line:

-vm C:Program Files (x86)Javajre7binjavaw.exe

Program Files (x86) is the folder where 64-bit Windows places 32-bit programs.

Program Files is the folder where 64-bit Windows places 64-bit programs.

This can happen when a system has more than one JVM installed, as is often the case on Windows 64-bit (for example, the JRE download page uses the bit-ness of the browser to determine what bit-ness download to offer you, and many people use(d) 32-bit browsers even though they run 64-bit Windows).

The best way to fix this, assuming you do in fact have 64-bit JRE or JDK on your system, is to specify in eclipse.ini exactly which JVM you want it to use. The instructions are detailed in the Eclipse wiki page, but basically you have to specify the -vm option in the ini file — make sure to read the wiki page carefully as the format is very specific.

Specifying the JVM path in eclipse.ini is strongly recommended because doing so isolates Eclipse from any potential changes to your system PATH that some program installers might make (I’m talking to you, Oracle!).

Another option would be to download and use 32-bit Eclipse instead of 64-bit, but it’s still strongly recommended to specify the path to the JVM in eclipse.ini.


Left for historical reference:

To check your version of Java, run

  java -version 

in a console (command prompt). On Windows 7 with 64-bit Java 6 I get:

  java version "1.6.0_27"
  Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
  Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

Note the 3rd line, which shows that this is a 64-bit version.

On a 32-bit version you’ll get something like:

  Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) 

If you are on a 64-bit machine, then you can install the 64-bit JDK and uninstall the 32-bit one. For instance on Windows 10, just go to Settings and under Apps, you will find Java. Click on it and you will find all the different versions. Now you can select which one to uninstall.

Viewing 10 replies — 1 through 10 (of 10 total)

  • @ijbine

    You have a conflict with the scrollbar javascript code.

    Uncaught Error: 
    no element is specified to initialize PerfectScrollbar at new PerfectScrollbar

    https://github.com/mdbootstrap/perfect-scrollbar

    Thread Starter
    ijbine

    (@ijbine)

    Hi @missveronicatv

    Thank you for your answer. Sorry, I’m not an expert on coding and such, i just know a very little about adding some additional CSS and stuff.

    Could you tell me please what I have to do to fix this problem ? Do I have to download something on github and then install it ?

    Thank you very much for your help !

    Hi,

    Can you do a conflict test and see if the issue goes away? This doc explains how to do a conflict test if you are not sure: How to do a plugin/theme conflict test?

    Regards,

    Thread Starter
    ijbine

    (@ijbine)

    Hi @champsupertramp

    Thank you very much for your answer.

    I did the conflict test, indeed after switching my theme from Vilva Pro to Twenty One it was working normally…

    Is it possible to solve it from here or do I have to contact my Vilva Pro provider ?

    Thanks

    • This reply was modified 1 year, 8 months ago by ijbine.

    @champsupertramp

    The call getting the PerfectScrollbar error seems to be from UM:

    jQuery(document).trigger("um_build_template",[e,r])

    with the PerfectScrollbar error:

    if(!element||!element.nodeName){throw new Error('no element is specified to initialize PerfectScrollbar')}

    @ijbine

    Have you tested to disable the menu?
    Did you also test to disable the Jetpack plugin?

    Thread Starter
    ijbine

    (@ijbine)

    @missveronicatv

    I can’t turn off JetPack, it’s the only plugin that i can’t switch off i guess.

    But i tried different themes : Twenty Twenty One and another free theme called Maxwell, with both of them there are no problems at all with JetPack still active.

    It seems to be a problem with only my theme, so I took contact with the support team of my theme which is called Vilva Pro (developped by Blossom)

    I let you know when i get an answer and i’ll let you know if the problem will be solved.

    Thank you very much for taking time for me !

    Best regards

    • This reply was modified 1 year, 8 months ago by ijbine.

    Thread Starter
    ijbine

    (@ijbine)

    Alright, now I’m totally lost, but a happy lad lol.

    Just told you that it was working normally with other themes. I’ve just right now activated again my Vilva Pro theme and I don’t know why but finally after several days it seems that it works now.

    Can’t explain it, but well i’ll gladly accept it ^^

    I let you know if I have an explanation for this, so it could profit to someone else in the future.

    Again, huge thanks @missveronicatv @champsupertramp

    Thread Starter
    ijbine

    (@ijbine)

    Hi,

    Some updates. Indeed the problem is with the scrollbar, no doubts about that.

    It was working yesterday as I explained in previous post, but now again it doesn’t work and I have again an endless loop…

    But I don’t have this problem on my phone, and it’s quite logic because on phone there is no scrollbar, don’t know why (which can be disturbing btw).

    Does someone have an explanation for this ?

    Hi @ijbine

    Sorry for the late response. Did your theme developer respond to your issue?

    Regards,

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

  • Viewing 10 replies — 1 through 10 (of 10 total)

    Expected behavior Project should Compile without Console error

    Actual behavior Any new project gives tones of warning of Uncaught Error: no element is specified to initialize PerfectScrollbar

    Resources (screenshots, code snippets etc.) mdb.js:7707

    http://localhost:51053/Scripts/mdb.js:7707


    Krzysztof Wilk
    staff
    commented 2 years ago

    Hi!

    I can’t reach the link you provided. Localhost is a server that only exists on your computer. Could you make a snippet using our online editor (https://mdbootstrap.com/snippets/) with code that causes an error?

    Best regards

    Please insert min. 15 characters.


    anandbohra
    pro
    commented 2 years ago

    the moment I add any project the console is loaded with Uncaught Error: no element is specified to initialize PerfectScrollbar

    why is it so?

    Please insert min. 15 characters.


    Krzysztof Wilk
    staff
    commented 2 years ago

    Hi!

    I’m afraid I can’t recognize the problem without a code.

    Best regards

    Please insert min. 15 characters.


    Понравилась статья? Поделить с друзьями:
  • Uncaught error invalidstateerror the connection has not been established yet
  • Uncaught error class memcache not found in
  • Uncaught error injector modulerr
  • Uncaught error extension context invalidated
  • Uncaught error expected the reducer to be a function