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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:16:11+00:00 2026-06-10T13:16:11+00:00

I have a <div> full of <ul> elements. When i hover over one of

  • 0

I have a <div> full of <ul> elements. When i hover over one of these elements i want to make adjustments to the html markup.

my standard <ul> items look like this:

<ul>
    <li class="category"><img src="source" /></li>
    <li class="time days"><p>text</p></li>
    <li class="participant participant_one"><p><img src="source" />text</p></li>
    <li class="divider"><p>:</p></li>
    <li class="participant participant_two"><p><img src="source" />text</p></li>
    <li class="event_type"><p>Event</p></li>
    <li class="event_name"><p>text</p></li>
    <li class="hot"><p>945°</p></li>
    <li class="rating"><p>4.99</p></li>
    <li class="comments"><p>7.544</p></li>
    <li class="marked"></li>
</ul>

now on hover i want this element to look like this:

<ul class="expanded">
    <li class="category"><img src="img/headlines_category_icon_1.png"></li>
    <li class="time days"><p>29.05</p></li>
    <li class="icon participant_one_icon"><img src="img/user_icon_36-36_1.png"></li>
    <li class="icon participant_two_icon"><img src="img/user_icon_36-36_1.png"></li>
    <li class="headline">
        <ul>
            <li class="participant participant_one"><p>Text</p></li>
            <li><p>:</p></li>
            <li class="participant participant_two"><p>Text</p></li>
        </ul>
        <p><span>Event</span> Eventname</p>
    </li>
    <li class="actions">
        <ul class="actions_ul">
            <li class="bookmark"><a href="#">Bookmark</a></li>
            <li class="comment"><a href="#">Comment</a></li>
            <li class="share"><a href="#">Share</a></li>
        </ul>
    </li>
</ul>

i want to accomplish this using jquery and i tried following:

$('div.match_entries ul').mouseenter(function() {
    $(this).addClass('expanded');
    category = $(this).children('li.category');
    time = $(this).children('li.time');
    participant_one_original = $(this).children('li.participant_one');
    participant_one_icon = $(this).children('li.participant_one img');
    participant_one = $(this).children('li.participant_one').remove('img');
    participant_two_original = $(this).children('li.participant_two');
    participant_two_icon = $(this).children('li.participant_two img');
    participant_two = $(this).children('li.participant_two').remove('img');
    divider = $(this).children('li.divider');
    event_type_original = $(this).children('li.event_type');
    event_type = $(this).children('li.event_type p').text();
    event_name_original = $(this).children('li.event_name');
    event_name = $(this).children('li.event_name p').text();
    hot = $(this).children('li.hot');
    rating = $(this).children('li.rating');
    comment = $(this).children('li.comment');
    marked = $(this).children('li.marked');

    $(this).empty();

    $(this).append($(category));
    $(this).append($(time));
    $(this).append('<li class="icon participant_one_icon'+$(participant_one_icon)+'</li>');
    $(this).append('<li class="icon participant_two_icon'+$(participant_two_icon).text()+'</li>');
    $(this).append('<li class="headline"><ul>'+$(participant_one)+'<li><p>:</p></li>'+$(participant_two)+'</ul><p><span>'+$(event_type)+'</span> '+$(event_name)+'</p></li>');

}).mouseleave(function(){
    $(this).removeClass('expanded');
    $(this).empty();
    // APPEND ORIGINAL STUFF
})

Doesn’t work quite… $(category) and $(time) are appended in the right way but the others are included as object Object

Any hints?

  • 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-10T13:16:13+00:00Added an answer on June 10, 2026 at 1:16 pm

    If you have such information to be changed on hover, maybe you should think of having directly the expanded version has an hidden one, so on hover you only have to hide the original one and then display the hidden one.

    <ul class="original">
       <li> ... <li>
       <li> ... <li>
    </ul>
    
    <ul class="hidden">
       <li> ... <li>
       <li> ... <li>
    </ul>
    

    JS part

    $('body').on('mouseenter','ul.original',function() {
       $(this).addClass('hidden')
              .next().removeClass('hidden');
    }).on('mouseleave', 'ul.original', function(){
       $(this).removeClass('hidden')
              .next().addClass('hidden');
    });
    

    CSS

    .hidden { display: none; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a seemingly simple html construct: <div class=featured-image img-wrapper full-width> <a href=http://localhost/wordpress/?p=26> <img
If I have the following markup <html> <body> <div id=wrapper> <div id=container> <p>Lots of
I have div ( #child ) which won't expand to the full height of
Suppose I have div and I want to fetch data and push data into
in my html page I have div with css: padding: 0px; color: rgb(51, 51,
I have a div which contain lots of input[type=text] fields. I want to put
I have a form with one text box that is part of a div
What I want is to have mutliple divs after one another, that each is
I have a div section, which is full of <a href=> tags, on a
I have multiple elements each has a short and main divs. I want 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.