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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:54:05+00:00 2026-05-28T06:54:05+00:00

I have to create an ‘X’ that pops up over the top right div

  • 0

I have to create an ‘X’ that pops up over the top right div that is moused over. There are multiple divs that I need this to happen on, on the page. I have been able to achieve this on one div with the following very simple JQuery:

$(document).ready(function () {
    $(".imagetrigger").mouseover(function() {
        $(".xdiv").fadeIn();
    })

    $(".xdiv").mouseover(function() {
        $(".xdiv").show();
    })

    $(".imagetrigger").mouseout(function() {
        $(".xdiv").fadeOut();
    })
});

But, I don’t want to have to write this out over and over again for all the divs on the page. The xdiv would also have to move position to be positioned correctly with the other divs and I was thinking of achieving this by using .addclass to add a new class to the xdiv with the updated margin positioning.

I appreciate any help or guidance offered.

After some further investigation I was able to get it to work.
My JQuery now reads as following:

$(document).ready(function () {
  $(".preview").hover(
      function () {
        $(".xdiv",this).show();
      },
      function () {
        $(".xdiv",this).hide();
      }
  );

});

I am still not sure why using the .children selector wasn’t working and I will look into that, but the above work for me. Thanks for the help folks. I will be putting this in as the answer after the 6-8 hour cool down period is over.

  • 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-28T06:54:06+00:00Added an answer on May 28, 2026 at 6:54 am

    Here is an example to what i think you need.

    What it does is (on mouseover) shows the cross in the top-right corner and hides it on mouseleave. You could then have a click function on the cross in the corner to do something from there.

    HTML

    <div id="box1" class="clickable">
      <div class="cross"></div>
    
      YOUR CONTENT
    </div>
    

    CSS

    div.clickable
      {
        width:200px;
        height:200px;
        overflow:hidden;
        position:relative;
      }
    div.cross
      {
        position:absolute;
        top:0px;
        right:0px;
        width:20px;
        height:20px;
        background-image:YOUR CROSS IMAGE
        display:none;
      }
    

    Javascript (using jQuery Library)

    $(".clickable").hover(
      function () {
        $(this).children(".cross").show();
      },
      function () {
        $(this).children(".cross").hide();
      }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have create my own NSOpenGLView class, right now the data that i want
I have create name range on sheet A so I need to use this
I have create a custom contextMenu using AS3 and can apply that to the
I have create a class MyConnection that extends NSURLConnection. I have implemented some delegate
we have create a web application on top of google app engine and python.
I have create a class that extends BaseAdapter . At the same time, tt
I have create testing application that has 3 classes Car Radio SportCar : Car
I have create some javascript links. But on hover there is no cursor. How
I have create a web site and I need to read data which is
I have create a site embedded Google mapusing api V3 that shows our 4

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.