We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45322
    • 9 Posts
    I have a site where users can log in when on a PC it creates a really nice pop up for them to fill in , how ever, this pop up fails to load for mobile devices, most of the site is quite fluid so it will work to some degree with all devices, everything I have looked at call for mobile detection to load a new template, is their anything to switch the hyper link from:
    <a href="#login" >login</a>
    to
    < href="mysite.com/login.html">Login</a>
    if a mobile device is detected to have access the site

    no template switchin required just a change of anchor

    I can provide link to the site for the login if that helps but I am not sur what the protocol is for posting links back to your own site
      • 38290
      • 712 Posts
      Since detecting mobile server side can be a nightmare, one option would be to use JavaScript to detect touch devices. This can be done with conditionzr or modernizr. You would set two href links, the default and another using a data attribute
      data-mobile-href="mysite/login.html"


      and some js to conditionally change the link
      if(Modernizr.isTouch) element.data('href', element.data('mobile-href'))
        jpdevries