Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Thanked 0 Times in 0 Posts

    Run a script only for desktop users?

    Hello all,

    I'm pretty inexperienced with javascript, but I found a tutorial on creating a "floating" navigation bar. We use it for a vertical left-navigation as opposed to the horizontal navigation used in the guide:


    It ended up working great, aside from one problem: on mobile devices, if you zoom, the menu sticks to the left side of the screen, rather than staying within it's div on the left side of the page.

    I'm not sure if there's any way to fix that, but if there's not, I was hoping that I could at least somehow tell the script only to run on non-mobile devices, if that's at all possible.

    Here is the page I am using it on, just for reference:


    Thanks for any and all help!


  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    Shrink your browser window way down vertically and/or change the zoom factor and you have similar problems even with desktop browser.

    With Chrome, and with zoom set at 200%, at one point the Nav menu moved halfway off the screen and I couldn't get it back except by refreshing the page.

    So the whole thing seems to have issues.
    Be yourself. No one else is as qualified.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts