Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8469047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:06:55+00:00 2026-06-10T16:06:55+00:00

I have been asked to patch up a rather badly written responsive website at

  • 0

I have been asked to patch up a rather badly written responsive website at work, and have been left stumped by an issue with a jQuery click event.

The event works fine on iPhone in Landscape mode, but in Portrait mode it doesn’t do anything.

Here’s the jQuery:

if (width <= 480) {
    function menu(e) {
        e.PreventDefault();
        $('#menu-item-93 .sub-menu').slideToggle('fast');
    }

    $('.nav-cont').addEventListener('click', menu(e));
    $('.nav-cont').addEventListener('touchstart', menu(e));
}

And the section thats relevant from the header.php file (did I mention, this is a WordPress site)

<nav id="main" class="main clearboth">
    <?php 
        wp_nav_menu( array( 
            'sort_column' => 'menu_order', 
            'theme_location' => 'primary', 
            'after'=>'<img src="'.template_url('images/button/link-445x68.png').'" class="show-480" />'
        ) );
    ?>
</nav>
<div class="nav-cont">
    <div class="nav-text show-480">NAVIGATION</div>
    <img class="nav-button show-480" src="<?php echo template_url('images/button/navigation-closed-nt-445x52.png');?>" />
</div>

Anyone have any idea why this touch event only fires in landscape mode?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:06:57+00:00Added an answer on June 10, 2026 at 4:06 pm

    This was solved in the end by going through multiple javascript files left by the old development agency who were working on the site. I found that there were multiple instances of click handlers on this selector which were contradicting each other. I removed the others and bam, it worked.

    It even worked in the way I originally intend for it to work with a basic

    $('.nav-cont').click(function() {
    });
    

    event handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I have been asked to remove a menu item on a website running
Although this question have been asked and answered before, including on this website, I
I have been asked to build a rather simple form processor application that interacts
I have been asked to make some changes to a friend's company website. It
This question has been asked before, but not with this exact issue. I have
I have been asked to improve the memory efficiency of an application that is
I have been asked to write a script that pulls the latest code from
We have been asked to increase the performance of a clients site search. Before
I have been asked by my supervisor to develop a web application using either
I have been asked to get details of every user that logs into our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.