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 3223870
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:09:26+00:00 2026-05-17T16:09:26+00:00

Hope someone can help. I have the code below which when the user hovers

  • 0

Hope someone can help. I have the code below which when the user hovers over the name the image and text in the div on the right changes.

How can I delay the hover so that when the user swipes across the page it doesnt change the content quickly… if that makes sense

<head>

<script type='text/javascript' src='http://code.jquery.com/jquery-1.4.2.min.js'></script>


<script>$(document).ready(function() {
    switches = $('.switches > li');
    slides = $('#slides > div');
    switches.each(function(idx) {
            $(this).data('slide', slides.eq(idx));
        }).hover(
        function() {
            switches.removeClass('active');
            slides.removeClass('active');             
            $(this).addClass('active');  
            $(this).data('slide').addClass('active');
        });
    });</script>




    <style type="text/css">

.switches .active {
  font-weight: bold;
}

.switches {
 list-style-type:none;
 font-family:Arial, Helvetica, sans-serif;
 font-size:12px;
 line-height:21px;
 cursor:pointer;
 padding:0;


}

#slides div {
  display: none;
}

#slides div.active {
  display: block;
}

</style>

</head>

<body>


   <div id="people">

<h1>Our People<br />
</h1>

<table width="912" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="175" valign="top">
    <ul class="switches">
  <li class="active">Philip Havers QC</li>
  <li>Robert Seabrook QC</li>
  <li>James Badenoch QC</li>
  <li>Stephen Miller QC</li>
  <li>Kieran Coonan QC</li>
  <li>Terence Coghlan QC</li>
  </ul>

    </td>
    <td width="186" valign="top">
    <ul class="switches">
      <li>Guy Mansfield QC</li>
      <li>Sally Smith QC</li>
      <li>Elizabeth-Anne Gumbel QC</li>
      <li>Paul Rees QC</li>
      <li>Margaret Bowron QC</li>
      <li>Neil Garnham QC</li>

      </ul>
      </td>
    <td width="170" valign="top">
      <ul class="switches">
      <li>David Balcombe QC</li>
      <li>Joanna Glynn QC</li>
      <li>David Hart QC</li>
      <li>Martin Forde QC</li>
      <li>William Edis QC</li>
      <li>Wendy Outhwaite QC</li>
      </ul>
      </td>

    <td width="221" valign="top">
    <ul class="switches">
      <li>Wendy Outhwaite QC</li>
      <li>Angus McCullough QC</li>
      <li>Philippa Whipple QC</li>
      <li>Christina Lambert QC</li>
      </ul>
      </td>
    <td width="160" rowspan="3" valign="top">

<div id="slides">
  <div class="active"><img src="images/paul.jpg" width="160" height="178" alt="Paul" />
  Paul Woods, 
Senior Partner

    <a href="#">View CV ></a> 
</div>

  <div><img src="images/paul2.jpg" width="160" height="178" alt="Paul" /></div>
  <div><img src="images/paul3.jpg" width="160" height="178" alt="Paul" /></div>
  <div>I'm gone!</div>
  <div>kiren</div>
  <div>terence</div>
  <div>guy</div>
</div>



    </td>
  </tr>
  <tr>
    <td height="29" colspan="4">&nbsp;</td>
    </tr>
  <tr>
    <td><ul class="switches">
      <li>John Gimlette</li>              
<li>Marina Wheeler</li>            
<li>David Evans</li>                
<li>Henry Witcomb</li>               
<li>Andrew Kennedy</li>               
<li>John Whitting</li>               
<li>Martin Downs</li>
</ul>
</td>
    <td>
    <ul class="switches">
    Justin Levinson 
    <li>Sarah Lambert</li>
    <li>Owain Thomas</li>
    <li>Jeremy Hyam</li>
    <li>Oliver Sanders</li>
    <li>Ben Collins</li>
    <li>Shaheen Rahman</li>
    </ul>
    </td>
    <td>
    <ul class="switches">
    <li>Richard Smith</li>
    <li>Christopher Mellor</li>
    <li>Robert Kellar</li>
    <li>Matthew Barnes</li>
    <li>Sarabjit Singh</li>
    <li>David Manknell</li>
    </ul>
    </td>
    <td>
    <ul class="switches">
    <li>Richard Mumford</li>
    <li>John Jolliffe</li>
    <li>Rachel Marcus</li>
    <li>Pritesh Rathod</li>
    <li>Caroline Cross</li>
    <li>Matthew Donmall</li>
    <li>Suzanne Lambert</li>
    </ul>
    </td>
    </tr>
</table>
</div>


</div>

</body>
</html>
  • 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-05-17T16:09:27+00:00Added an answer on May 17, 2026 at 4:09 pm

    If all you want is a delay you could add a timeout, which would change your JavaScript to something like:

    $(document).ready(function() {
        var timeout = null;
        var delay = 500;
        var switches = $('.switches > li');
        var slides = $('#slides > div');
        switches
            .each(function(idx) { $(this).data('slide', slides.eq(idx)); })
            .hover(
                function() {
                    var hoveredElement = $(this);
                    timeout = setTimeout(function(){
                        switches.removeClass('active');
                        slides.removeClass('active');             
                        hoveredElement.addClass('active');  
                        hoveredElement.data('slide').addClass('active');
                    }, delay);
                },
                function(){
                    clearTimeout(timeout);
                    slides.removeClass('active');
                });
        });
    

    Further to this it would probably be nicer if you maybe faded in the content on the slides, using the animate() and stop() methods to stop it going crazy if the user hovered over lots of options.

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

Sidebar

Related Questions

No related questions found

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.