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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:18:44+00:00 2026-05-28T08:18:44+00:00

I am attaching onmouseover event to an image. The mouseover event should create a

  • 0

I am attaching onmouseover event to an image. The mouseover event should create a div and add to the same position where image was placed. The div is used as a floating menu div. I can get the coordinates but for some reason when I add the div to the document I am not able to see the div anywhere.

    $(actionImage).mouseover(function(e) {

            // get the coordinates
            var x = e.pageX - this.offsetLeft; 
            var y = e.pageY - this.offsetTop;

            var menuDiv = createMenuDiv();

            $(menuDiv).css(
                {   
                    position:"absolute",
                    top: y + "px",
                    left:x + "px"
                }
            );


            $(document).append(menuDiv);


        });


function createMenuDiv() {

    var menuDiv = document.createElement("div");
    $(menuDiv).css("background-color", "yellow");
    $(menuDiv).css("z-index", "99");


    var b = document.createElement("input");

    $(menuDiv).append(b);

//  var addButtonLabel = document.createElement("label");
//  $(addButtonLabel).text("Add");
//  
//  var deleteButtonLabel = document.createElement("label");
//  $(deleteButtonLabel).text("Delete");

//  $(menuDiv).append(addButtonLabel);
//  $(menuDiv).append(deleteButtonLabel);

    return menuDiv; 

}
  • 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-28T08:18:45+00:00Added an answer on May 28, 2026 at 8:18 am

    It should use $('body').append(menuDiv); instead of $(document).append(menuDiv);;
    http://jsfiddle.net/ZPh3U/

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

Sidebar

Related Questions

When attaching a function to the onmouseover event for an SVG group <g>...</g> ,
Is there an advantage to dynamically attaching/detaching event handlers? Would manually detaching handlers help
How does one go about attaching a bunch of code to an onkeydown event,
Coding in Delphi, attaching an OnKeyPress event handler to a TStringGrid: The OnKeyPress event
I am attaching onclick event on dynamically created button but the event is not
In as3, I am adding event listener and then attaching the anonymous function to
I'm trying to reduce my 'onmouseover' event listeners in my table (in which I
I am attaching to the AppDomain.AssemblyResolve event and then calling Assembly.Load(byte[]) to load the
Is there a cross browser method of attaching some content in a <div> to
I was trying recycle code for saving an image and attaching it to an

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.