javascript - hashchange event not being fired on mobile chrome (Wordpress site) -
in wordpress site, i've created modal shortcode, opens modal when modal's "name" in hash part of location.
 instance /#contact-us open "contact us" modal.  
to have hashchange event listener on window, using jquery, so:  
$(document).ready(function () {     $(window).on('hashchange', function () {         openmodal();     });         });      on laptop, works pretty fine.
the problem when try on mobile phone (nexus 5 - chrome & firefox), , when use chrome's devtools emulator, when clicking on anchor href="#contact-us", won't work - hash in url changes event handler not being called.  
the weird thing if manually add hash url, event handler called.
i thought there might handler stoping propagation or that, tried using jquery's _data function (as mentioned here) see if there handlers, couldn't find any.  
so guess question is, why isn't working? , else can find out event "getting lost"?
thanks in advance
 
 
  
Comments
Post a Comment