• I’m using the menu links option, but when i click it jumps down without smooth scrolling effect andthen animated the offset – why is this happening? Buttons and so on worls just fine but not the menu links. I have tried the lin relations as shown in documentary aswell but that didnt work either.

    What can be done?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author malihu

    (@malihu)

    There’s a chance that your theme has its own function for same-page menu links, which might prevent “Page scroll to id” from working.

    I can’t really say though, unless I see your page in action. If you can post your link I’d be able to provide more help and/or a solution.

    Thread Starter Magnuspil

    (@magnuspil)

    The oage is down due to some dns failure – i’ll podt the link asap as soon as it’s up!

    Thread Starter Magnuspil

    (@magnuspil)

    Page should be up – try clickinh on the info menu link – it should replicate what i have described

    Plugin Author malihu

    (@malihu)

    What’s your link? I tried mastercraftgaming.net without success.

    Thread Starter Magnuspil

    (@magnuspil)

    sorry – monera.adamhyldkrog.com ??

    Plugin Author malihu

    (@malihu)

    Your theme has a script which prevents “Page scroll to id” from handling your menu links and scroll the page.

    The script is:
    ...themes/finance/functions/js/custom.js

    The code that handles your menu links is on line 373:

    
    $(location).attr('href', dttheme_urls.url+'/' + $(this).attr('href'));
    

    I’m not sure why this code is added but if you remove/comment it, the problem will be fixed.

    • This reply was modified 8 years, 3 months ago by malihu.
    • This reply was modified 8 years, 3 months ago by malihu.
    Thread Starter Magnuspil

    (@magnuspil)

    Can it be overwritte somehow, so i can prevent it from being activated again when i update the theme?
    Would it be possible to create a simple js script to overwrite it? I have made small plugins before, so im familiar with the startup process.

    • This reply was modified 8 years, 3 months ago by Magnuspil.
    Plugin Author malihu

    (@malihu)

    If you can add custom javascript in your theme you can try the following:

    
    (function($){
    	$(window).on("load",function(){
    		var sel="a.__mPS2id",$events=$._data($(sel)[0],"events");
    		for(var i=$events.click.length-1; i>=0; i--){
    			var handler=$events.click[i];
    			if(handler && handler.namespace != "mPS2id") $(sel).off("click",handler.handler)
    		}
    	});
    })(jQuery);
    

    If your theme does not provide a field to add custom js code, you should add the above in your child theme’s footer.php after wp_footer(); function.

    Hope this helps

    Thread Starter Magnuspil

    (@magnuspil)

    Can you recommend any plugins that’s good and simpel to add this (Custom JS plugins)? Hell of work to create a child theme and so.

    Thread Starter Magnuspil

    (@magnuspil)

    Can you maybe push this as an edit to your plugin? With a tickbox so people can turn this overwrite on/off – seems like some people have this problem.

    Plugin Author malihu

    (@malihu)

    Thanks for the suggestion. I have such a feature planned for the next version.

    For now, you can use something like “Simple Custom CSS and JS” from WordPress Plugin Directory.

    Thread Starter Magnuspil

    (@magnuspil)

    I already use that, and it doesnt seem to wanna overwrite it. What settings should i use in custom CSS and js? External or Internal script?

    WP header or WP Footer? I suppose footer, but not sure.

    Plugin Author malihu

    (@malihu)

    WP Footer is correct.
    The issue is that the “Simple Custom CSS and JS” plugin script is included/loaded before all the other scripts. The code I posted should be included <b>after</b> the theme scripts, so it successfully unbinds the click event(s).

    Try changing the code I posted to the following (it runs the code after few milliseconds)

    
    (function($){
      $(window).on("load",function(){
        setTimeout(function(){
          var sel="a.__mPS2id",$events=$._data($(sel)[0],"events");
          for(var i=$events.click.length-1; i>=0; i--){
            var handler=$events.click[i];
            if(handler && handler.namespace != "mPS2id") $(sel).off("click",handler.handler)
          }
        },700);
      });
    })(jQuery);
    

    Let me know if this works

    • This reply was modified 8 years, 3 months ago by malihu.
    Thread Starter Magnuspil

    (@magnuspil)

    Doesnt seem so, we will run with temporary solution, the comment out the snippet, until you can provide an official update. I do also have another problem, scrolling is chopy and not very good – what can it be? It’s on the same site: monera.adamhyldkrog.com.

    Plugin Author malihu

    (@malihu)

    I can’t really say.
    It might be your theme’s custom scrollbar in relation to your content. I also cannot use the mouse-wheel when hovering over the content (I can use it only when cursor is over the scrollbar).

    You also have some images with huge width (6000 pixels) which might affect scrolling.

    In addition, I get a few console errors (browser’s developer tools > console) with some files not found and a javascript error.

    • This reply was modified 8 years, 3 months ago by malihu.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Menu links not working properly’ is closed to new replies.