Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Anchor links do not work correctly on mobile



Index pages with anchor links to the various sections of the index are a very common website setup nowadays. Unfortunately the anchor links do not work correctly on mobile. In my case, when clicking an anchor link doesn’t close the menu and scroll to the correct section. 


My idea of solution is to add a click event. When clicking the anchor link, the mobile navigation will close.


But this function still not work at my website. Can anyone tell me is that anything I did wrong?


My website: I-kinball.org (pw: treats)

reference website: riverstonedigital.com  (mobile version)


This is the function I added:

//Anchor link fix
  function anchorLinks(){
// DOM Ready
  Y.on('domready', function(){

//RSD Mutation Boserver wrapper
  function RSD_init(){
// add watch function to window.onload
window.onload = RSD_watch;

// watch function to look for page changes using Mutation Observer
  function RSD_watch() {
    MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
    var mo = new MutationObserver(function(mo) {
      var moCount = 0;
      for (var b = 0; b < mo.length; b++) {
        var c = mo[b];
        if ("attributes" === c.type  && moCount === 0) {
    var options = { attributes : true, attributeFilter : ['id']};
    mo.observe(document.body, options);



Edited by orangechandesign
Link to comment

3 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...