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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:50:06+00:00 2026-06-16T01:50:06+00:00

Sorry if this question is explained a bit poorly JQuery is not my native

  • 0

Sorry if this question is explained a bit poorly JQuery is not my “native” language, so I’ll try to explain as best I can. (and I’ve set up a jsfiddle to help show the code) http://jsfiddle.net/6eYYR/

I have a webpage here: http://www.waranuwater.com.au/pages/test-1 I had a colleague assist me, in getting to the point I am now with the Jquery.

Scroll down to the second area, I have two divs set up side-by-side, one on the left contains an imagemap, the other on the right a “content area” with html content. The “content area” contains some text that will change when the user hovers over a part of the imagemap.

I’ve managed to get the content (which I have made black to make it easier to see for the timebeing) to change when the relevant part of the imagemap is hovered , when the user hovers over the imagemap, but I can’t work out how to have the initial content disappear when the hover occurs (the bit that starts with “Complete Contaminant Removal”)

This is my current Jquery code:

 function showHideDivs(indx){
            hideDivs();
            oShowHideDivs[indx].style.display = 'block';
        }
        function hideDivs(){
            for(i=0; i < oShowHideDivs.length; i++){
                oShowHideDivs[i].style.display = 'none';
            }
        }
        window.onload=function(){
            oShowHideDivs =  
document.getElementById('ccontainer').getElementsByTagName('div');
            var oMap = document.getElementById('myMap');
            for(i=0; i < oMap.areas.length; i++){
                oMap.areas[i].indx = i;
                oMap.areas[i].onmouseover=function(){showHideDivs(this.indx);}
                oMap.areas[i].onmouseout = hideDivs;
            }
        }

Am I missing something here? Do I need to tell Jquery to “hide” the existing text?, and if so how would I go about doing that?

Thanks in advance

  • 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-16T01:50:10+00:00Added an answer on June 16, 2026 at 1:50 am

    Your “initial content” is not inside any div, so it will be unaffected by your show/hide div logic. I’d suggest first placing it in its own div, just like the others:

    <div id="ccontainer">
        <div id="Sediment-Filter">...</div>
        <div id="Anti-Bacterial-Filter">...</div>
        <div id="Proteus-RO-Membrane">...</div>
        <div id="Activated-Coconut-Carbon">...</div>
        <div id="Initial-Contents">
            <h3>Complete Contaminant Removal</h3>
            <p>What truly sets this system apart ...
            ...
        </div>
    </div>
    

    Now it will be hidden just like the others when hideDivs is called. Your next step is show it by default when the other divs are hidden:

        function hideDivs(showInitial){
            for(i=0; i < oShowHideDivs.length; i++){
                oShowHideDivs[i].style.display = 'none';
            }
            if ( showInitial )
                document.getElementById('Initial-Contents').style.display = 'block';
        }
    

    …unless you’re showing a specific div:

    function showHideDivs(indx){
        hideDivs(false); // Don't show initial contents
        oShowHideDivs[indx].style.display = 'block';
    }
    

    Note that showInitial is “truthy” when it’s an Event object, so you can still use it directly in the oMap.areas[i].onmouseout = hideDivs; line.

    (BTW your question does not use jQuery, just vanilla JavaScript – though there is jQuery elsewhere in your page)

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

Sidebar

Related Questions

sorry for asking this dumb question i will try to explain as good as
Sorry if that question was a bit unclear. Let me try to explain. I
Sorry, don't know how to formulate this question. I'll try to explain. Here's a
Sorry if this question is a bit open ended, but I'm pretty new to
Sorry if this question is too vague, but I'd rather not muddy it's point
Sorry if this question is very easy, but I can't find the answer anywhere.
sorry if this question is stupid, but I can't wrap my head around Java
Sorry folks but I asked a question earlier and perhaps did not explain myself
This may not be explained the best but here it goes. I have a
Sorry if this question seems stupid, but it's stumped me for a couple days,

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.