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

  • Home
  • SEARCH
  • 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 4584440
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:21:19+00:00 2026-05-21T21:21:19+00:00

Being new to jQuery (but not vanilla JS) I am completely baffled why the

  • 0

Being new to jQuery (but not vanilla JS) I am completely baffled why the following hover effect works in FF, Chrome, Safari, but not in IE! I got this script from one of Carl Meyer’s post here; changing only the object id’s to match my markup.

You can find a working example of this page here, but here’s the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
<title>test</title>  
    <script type="text/javascript" language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    <script type="text/javascript" language="JavaScript">
        $(document).ready(function() {
            toolButtons = $('#toolButtons > li');
            insideCenter = $('#insideCenter > div');
            toolButtons.each(function(idx) {
                    $(this).data('slide', insideCenter.eq(idx));
                }).hover(
                function() {
                    toolButtons.removeClass('active');
                    insideCenter.removeClass('active');             
                    $(this).addClass('active');  
                    $(this).data('slide').addClass('active');
                });
            });
    </script>
    <style type="text/css">  
        #toolButtons .active {   font-weight: bold; }  
        #insideCenter div {   display: none; }  
        #insideCenter div.active {   display: block; }  
    </style> 
 </head>

 <body>
    <ul id="toolButtons">   
        <li class="active">First slide</li>   
        <li>Second slide</li>   
        <li>Third slide</li>   
        <li>Fourth slide</li> 
    </ul> 
    <div id="insideCenter">   
        <div id="slide1" class="active">Well well.</div>   
        <div id="slide2">Oh no!</div>   
        <div id="slide3">You again?</div>   
        <div id="slide4">I'm gone!</div> 
    </div>
 </body>
</html>

Any help is greatly appreciated!

vinnie

  • 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-21T21:21:20+00:00Added an answer on May 21, 2026 at 9:21 pm

    Call var toolButtons = $('#toolButtons > li'); and var insideCenter = $('#insideCenter > div');.

    You dropped the var and it can’t be seen as it is trying to set a global variable. Use var whenever possible, especially if the variable is not global.

    EDIT: Pure jQuery:

    $(document).ready(function() {             
       $('#toolButtons > li').each(function(idx) {                     
            $(this).data('slide', $('#insideCenter > div').eq(idx));                 
        }).hover(                 
            function() {                     
                $('#toolButtons > li').removeClass('active');
                $('#insideCenter > div').removeClass('active');                                  
                $(this).addClass('active');                       
                $(this).data('slide').addClass('active');                 
            });             
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I figured this would be simple, but being new to SSRS I'm not sure.
I'm new to Struts2, but I'm consistently running into issues with jQuery selectors not
Fairly new to Jquery here.... but one thing I have been told and being
I am somewhat new to Jquery but I feel complete failure here at not
I am fairly new to JQuery. That being said I am trying to use
Being new to OpenCL i would like to know if the following scenario is
I got started by following this awesome tutorial , but wanted to do the
I'm new to jQuery but want to use this form validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ In
I'm new to jquery, looked at some tutorials, but I can't even get myself
i think i am not going about this quite right, being very new to

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.