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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:56:50+00:00 2026-05-19T23:56:50+00:00

I have a PHP-script listing up to 20 card game players per page: I

  • 0

I have a PHP-script listing up to 20 card game players per page:

enter image description here

I also have photo/avatar-URLs for the most of players and I’d like to display them – as a floating image when the mouse hovers over corresponding link/name. I do not have the dimensions of the photos though.

How could I do it with the means of jQuery core (without plugins) please?

I probably need to create an image holder and hide it first?

$('body').append('<div id="avatar"><img src="no_avatar.gif"</div>').hide();

And then on mouse hover event replace the img’s src attribute and make the #avatar visible? Please help me with the code

Should I store the URL of each photo as an attribute of the corresponding
<a href="player_profile.php">player name</a> while generating them by my PHP-script?

And how to deal with situations when the mouse is hovering near the bottom of the web page (i.e. how do place the image best, so that it is visible)

Thank you!
Alex

  • 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-19T23:56:51+00:00Added an answer on May 19, 2026 at 11:56 pm

    I’m still learning jQuery, but let me take a crack at this.

    Let’s suppose that there is a div for each player with their info and you want the image to appear when the user moves the mouse over it. Put a custom class and a custom html attribute on the div like so:

    <div class='.playerDiv' data-PlayerId='PLAYERID' > ... </div>
    

    For each player, you can include something like this in your html code for each row.

    <div id='image_[PLAYERID]' style='display:none; position:absolute' >
        <img src='[PATH TO YOUR IMAGE]' />
    </div>
    

    Your script could look like this (inside your $(document).ready handler

    $('.playerDiv').each( function() {
        var id = this.attr('data-PlayerId');
         .hover( function() {
            $('#image_' + id).show(); },
                 function() {
            $('#image_' + id).hide(); });
        });
    

    That should get you started. You will need to add jQuery code to set the image div’s to display in the exact position you want (Either where the mouse pointer is, or a set position in the row).

    Hope this helps!

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

Sidebar

Related Questions

I have a simple PHP script that outputs a dir listing in XML format.
I have a PHP script that runs as a CGI program and the HTTP
I have a PHP script that needs to determine if it's been executed via
I have a PHP script that initialises an image gallery. It loops through all
I have a PHP script that can encode a PNG image to a Base64
I have a PHP script that sends critical e-mails. I know how to check
I have a PHP script that processes file uploads. The script tries to organise
I have a php script which accesses a MSSQL2005 database, reads some data from
I have a PHP script (running on a Linux server) that ouputs the names
I have a PHP script that pushes the headers to allow a file 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.