#
  • design@iqonicthemes.com
Just a suggestion for a small code change.

Hello,

I support a customer who owns the template Appino for their website.

I do not own the template directly but I support a person who does.

I do not want to get support for it. The website works fine. However, I wanted to give my 2 pens of info debugging the item. You see there is the custom.js file that has a nice bit of code around line 254 if I recall.

    // Bind click handler to menu items
    // so we can get a fancy scroll animation
    menuItems.on('click', function() {

        var href = $(this).attr("href"),
            offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1;
        $('html, body').stop().animate({

            scrollTop: offsetTop
        }, 1500);
        e.preventDefault();
    });

That's so nice. It gives a nice flow movement whenever you click any of the menu items to scroll to the point in question.


That, however, creates an error in console. That error also causes a small jittery motion whenever you click the menu item before the smooth scrolling begins. It's barely noticeable but if you work on the template for some time you can notice it pretty clear.

You can easily fix that (and most importantly avoid the error in the console everytime there is a click)

I suggest changing the code to:

    // Bind click handler to menu items
    // so we can get a fancy scroll animation
    menuItems.on('click', function(e) {

        var href = $(this).attr("href"),
            offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1;
        $('html, body').stop().animate({

            scrollTop: offsetTop
        }, 1500);
        e.preventDefault();
    });

There. I have implemented the change on my customer's website for some time now and it works perfectly. Even the scroll is much smoother because of the error that doesn't pop up.

Just a suggestion. Would love to see it in the next updates.

With friendly regards

Alex.

Asked 1 month ago on May 26, 2020 10:02 PM Comments 1 times


  1. Generic placeholder image

    Krunal P replied


    Hi Alexandros Androutsos,

    We greatly appreciate your remarks and useful suggestions. The ideas and suggestions of innovative, thinking people are always welcome. You can see it in the next updates.

    Thanks for your message.

Recent Tickets
Theme Saperate Problems... 5 hours ago on July 2, 2020 3:19 PM Problem in revolution sli... 6 days ago on June 26, 2020 11:32 AM License issues 6 days ago on June 26, 2020 2:55 AM THEME IMPORTS WEIRDLY... 1 week ago on June 19, 2020 3:17 AM PREVIEW NOT SAME AS INSTA... 1 week ago on June 18, 2020 10:54 PM Permission Error for ENV ... 2 weeks ago on June 18, 2020 1:55 PM Favicon 2 weeks ago on June 18, 2020 9:55 AM .env 2 weeks ago on June 17, 2020 9:29 AM When I want to build apk,... 2 weeks ago on June 16, 2020 8:26 PM Unable to build the proje... 2 weeks ago on June 16, 2020 8:09 AM