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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:06:05+00:00 2026-06-13T18:06:05+00:00

I have 5 flags for 5 countries. If anyone mouseover the flags, a respective

  • 0

I have 5 flags for 5 countries. If anyone mouseover the flags, a respective div will be shown. If mouseout, the div will hide. If the flag is clicked, then i want to keep the div visible and disable the mouseout event. The following coding makes everything okay, but when someone clicks on the flag, then the previous flags don’t work but the next flags on click. If i click the last one flag first, then none of the previous flags work!!!

Please someone helps me.

Thanks for reading.

    <!-- popup UN -->
<div class="popup popup_hide popup_un" id="popup_un">
    <div class="popup_top"></div>
    <div class="popup_country">
        <img src="images/usa.gif" alt="USA">  
        <a href="#" class="hide_popup"><span class="close"></span></a>
        <div class="popup_country_text"> 
            <div class="popup_country_text_normal">  
            </div>
            <div class="btn_email_us"><a href="#"><img src="images/btn_email.jpg" alt="email us"></a></div>
        </div>
    </div>
</div> 


 <div id="footer_flag">
<a href="#" class="showPopup showPopupClicked" rel="popup_au"><img id="popup_au_img" src="images/au.gif" alt="AU"></a>
<a href="#" class="showPopup showPopupClicked" rel="popup_nz"><img id="popup_nz_img" src="images/nz.gif" alt="AU"></a>
<a href="#" class="showPopup showPopupClicked" rel="popup_uk"><img id="popup_uk_img" src="images/uk.png" alt="UK"></a>
<a href="#" class="showPopup showPopupClicked" rel="popup_canada"><img id="popup_canada_img" src="images/canada.png" alt="Canada"></a>
<a href="#" class="showPopup showPopupClicked" rel="popup_usa"><img id="popup_usa_img" src="images/usa.gif" alt="USA"></a>
<a href="#" class="showPopup showPopupClicked" rel="popup_un"><img id="popup_un_img" class="footer_flag_un" src="images/un.png" alt="UN"></a>

$(document).ready(function(){

    $('.showPopup').mouseover( function() {
        $('.popup').hide();
        $('#' + $(this).attr('rel')).show()  
    });


    $('.showPopup').mouseout( function() {
        $('.popup_hide').hide(); 

    });             

    $('.hide_popup').click( function() {
        $('.popup').hide(); 
        $('img').removeClass('border_grey'); 

    });


    $('.showPopupClicked').click( function() {
        $('a').removeClass('showPopup');
        $('img').removeClass('border_grey');
        $('.' + $(this).attr('rel')).removeClass('popup_hide');
        $('#' + $(this).attr('rel') + '_img').addClass('border_grey');

    }); 
});

]

  • 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-13T18:06:06+00:00Added an answer on June 13, 2026 at 6:06 pm

    CODE:

    var mouseOver = function() {
        //$('.popup').hide();
        $('#' + $(this).attr('rel')).show();
    };
    
    var mouseOut = function() {
        //$('.popup').hide();
        $('#' + $(this).attr('rel')).hide();
    };
    
    $('.showPopup').mouseover(mouseOver);
    $('.showPopup').mouseout(mouseOut);
    
    $('.showPopup').click(function() {
        $('#' + $(this).attr('rel') + '_img').removeClass('border_grey');
        if ($(this).hasClass("selected")) {
            $('#' + $(this).attr('rel')).hide();
            $(this).removeClass("selected");
    
            $(this).bind("mouseover", mouseOver);
            $(this).bind("mouseout", mouseOut);
        } else {
            $(this).addClass("selected");
            $('#' + $(this).attr('rel') + '_img').addClass('border_grey');
            $('#' + $(this).attr('rel')).show();
    
            $(this).unbind("mouseover", mouseOver);
            $(this).unbind("mouseout", mouseOut);
        }
    });
    

    Working fiddle

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

Sidebar

Related Questions

I have many flags that I want to store them in an integer, so
I have 10 country flags on my company's website (VS 2010/vb/asp.net4.0). Clicking a flag
I have a table that stores various types of flags. Each flag type has
I have some flags I store in my mysql database so I can dynamically
how do i switch on an enum which have the flags attribute set (or
I have a enum: [Flags] public enum EmailType { PasswordRecovery = 1, Activation =
i have this code: [Flags] public enum MyUriType { ForParse, ForDownload, Unknown } and
Let's say I have this enum: [Flags] enum Letters { A = 1, B
I have the following enum: [Flags] public enum PermissionLevel { User = 1, Administrator
I have enum like this [Flags] public enum Key { None = 0, A

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.