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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:16:53+00:00 2026-06-17T02:16:53+00:00

I am loading divs with information from the database using php code: for ($i=0;

  • 0

I am loading divs with information from the database using php code:

for ($i=0; $i < $stmt->rowCount(); $i++){
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    $name = $row['uc_name'];
    $image_url = $row['uc_image'];
    $color = $row['uc_color'];

The creates a box for however many rows there are: http://jsfiddle.net/pKR5t/1/

I am trying to create a drop down menu for each item retrieved from the database. When the user hovers over class="header", the drop down menu should show but the list inside should be pertaining to that of the box hovered:

enter image description here

I believe I can use the .on() function to accomplish this but I am completely lost on how to use it. Any help on getting this accomplished would be helpful. Thanks

  • 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-17T02:16:55+00:00Added an answer on June 17, 2026 at 2:16 am

    To use on and hover you will want to use the mouseenter and mouseleave events like so:

    $("div.box div.header").on("mouseenter", function() { //mouseenter event
        var currentBox = $(this).closest("div.box");
        var currentTitleText = $(this).find("div.title").html();
    
        //popup the list
    
    }).on("mouseleave", function() { //mouseleave event
        //close the list
    });
    

    For some additional info, check this post.

    EDIT

    Updated mouseover and mouseout to the slightly better mouseenter and mouseleave events.

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

Sidebar

Related Questions

After loading a PHP template (using jQuery's load function), this simple script won't make
I have written an AJAX script to read information from a database and inject
I have some javascript code on my webpage that is loading some divs onto
How could i use a php die function to only stop certain divs from
I have a loading image that works using the code below. It shows the
I'm loading content into a series of divs using $.load() , and it works
I'm loading content from a database into a page with jQuery ajax. I have
I am trying to loading sites from a JSON array to divs one by
I'm loading in 3 images (named 1.jpg, 2.jpg, 3jpg) dynamically to 3 divs called
When loading the class, using method forName() , any static initializers in the 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.