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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:00:44+00:00 2026-06-06T12:00:44+00:00

I am using Hovercard and it works perfectly with the following code: $.getJSON(userjson.php function(result){

  • 0

I am using Hovercard and it works perfectly with the following code:

$.getJSON("userjson.php"
    function(result){
        $('.user').hovercard({
            showCustomCard: true, 
            customCardJSON: result,
            openOnLeft: true
        });
    });

In the code above i am just taking the information that is stored in the database of the user that is currently logged in using cookies:

$username = $_COOKIE['username'];

$user_select = mysql_query("SELECT * FROM users WHERE username='$username'",$con);
$user_array = mysql_fetch_array($user_select);

$user = array(
    'name' => "<p style=\"text-align:left; text-decoration:underline;\">".$user_array['username']."</p>",
    'bio' => "<p style=\"text-align:left\"><br>".$user_array['bio']."</p>",
    'image' => "/pictures/users/".$user_array['propic']
);

echo json_encode($user);

However, I want to replace the user information from the current logged in user to the user who’s name is being hovered over:

$('.user').hover(function() {
    var obj = $(this);
$.getJSON("userjson.php",{name: obj.text()},
        function(result){
            obj.hovercard({
                showCustomCard: true, 
                customCardJSON: result,
                openOnLeft: true
            });
    });
});

This does work (to some extent). I have to hover over the name once and then another time for it to show and then it does not go away when i take the mouse away..

Here are 2 videos i took so that you actually have an idea about what I’m talking about:

Working code taking the logged in user: http://www.youtube.com/watch?v=FrWmOE-r8AA

Not working code taking the hovered username: http://www.youtube.com/watch?v=E9ksekpBnv0

I NEED HELP!

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

    The hover card should not be added upon hover but initially.

    $.each($(".user"), function() {
        var element = $(this);
        $.getJSON("userjson.php", {name: $(element).text()}, function(resp) {
            $(element).hovercard({
                showCustomCard: true, 
                customCardJSON: resp,
                openOnLeft: true
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using DMD 2.057, I cannot get the following code to compile: import std.stdio; import
I'm using http://designwithpc.com/Plugins/Hovercard , but I can't find out how to declare a var
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
I am using this plugin for hovercards..http://designwithpc.com/Plugins/Hovercard The problem with this plugin is when
Using boost python I need create nested namespace. Assume I have following cpp class

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.