• 0

Why does navigation work on PC but not device?


Question

So I'm making a website, which you can preview here: www.local-media.co.uk/roadhouse and my issue is that the navigation works at all 3 different screen size points flawlessly on the PC through Chrome or IE etc., but if you view the same page through a mobile browser the grey box you tap to open the navigation doesn't appear as a link and so the navigation is broken. Any ideas how I can make this work?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I don't see any javascript code that handles showing the menu when that menu button is clicked, can you post the code you're trying to use to make that menu work?

 

Also, at the bottom of your document, you have a script that's trying to use jQuery before jQuery is loaded:

<script type="text/javascript">$(document).ready(function(){$(window).scroll(function(){if($(this).scrollTop()>200){$('.go-top').fadeIn(200);}else{$('.go-top').fadeOut(200);}});$('.go-top').click(function(event){event.preventDefault();$('html, body').animate({scrollTop:0},300);})});</script>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>

You'll want to include jquery-1.10.2.min.js before you try and do anything that uses it ($(document.ready(...))

Link to comment
Share on other sites

  • 0

The CSS is used to style what the menus look like, but you don't have any code to make them actually work. The only clicks that the browser handles automatically are when someone clicks on an <a href=""> tag - browsers don't automatically handle showing and hiding menus. You'll need to have something like this:

$('#nav-indicator').click(function(e) {
    $('#nav').css('visibility','visible');
});

To show the main navigation when the user taps on the menu button, but you'll probably also want code hide it, as well as code to show/hide the submenus within the navigation.

Link to comment
Share on other sites

  • 0

Here is the link to the javascript file in question: https://www.dropbox.com/s/m4rekcv65ipbt2e/clientlibs.js.pagespeed.jm.ZdShIpFntW.js?dl=0

 

An odd thing started happening - when I preview the site through Dreamweaver the navigation works perfectly, but if I upload it to the test space in the OP the navigation doesn't work... These previews are based off the same files so I can't understand what could be happening!

Link to comment
Share on other sites

  • 0

Here is the link to the javascript file in question: https://www.dropbox.com/s/m4rekcv65ipbt2e/clientlibs.js.pagespeed.jm.ZdShIpFntW.js?dl=0

 

An odd thing started happening - when I preview the site through Dreamweaver the navigation works perfectly, but if I upload it to the test space in the OP the navigation doesn't work... These previews are based off the same files so I can't understand what could be happening!

What the heck is that for javascript? I almost get the feeling I'm looking at a base64 encoded string >.>

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.