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

  • SEARCH
  • Home
  • 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 6321135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:05:51+00:00 2026-05-24T16:05:51+00:00

Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/ $(document).ready(function(){ $(.altbgcolor).hover(function()

  • 0

Currently I have the below jQuery which uses the colorbox plugin http://colorpowered.com/colorbox/

$(document).ready(function(){


  $(".altbgcolor").hover(function() {
        $(this)
            .addClass('altbgcolor-active')
            .find(".sharedp")
            .slideDown('slow');
    },function () {
        $(this)
            .removeClass('altbgcolor-active')
            .find(".sharedp")
            .slideUp('slow');
    });
 $(".example7").colorbox({
        onOpen:function(){ alert('onOpen: colorbox is about to open'); },
        onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
        onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
        onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
        onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
)};

 });

I want to convert both the hover functionality and the colorbox function to jQuery .live() so that any new elements added at runtime live, without refreshing the page, has the jQuery attached to them.

Can anyone help me with same? I tried for the hover event using below code, but it seems to record only the mouse enter event

$(".altbgcolor").live('hover',function() {
        $(this)
            .addClass('altbgcolor-active')
            .find(".sharedp")
            .slideDown('slow');
    },function () {
        $(this)
            .removeClass('altbgcolor-active')
            .find(".sharedp")
            .slideUp('slow');
    });

Please help!

EDIT:

Used the below solution, it works and though the .addClass(‘altbgcolor-active’) seems to be working fine for the newly dynamically added elements, the .slideDown(‘slow’) or .slideUp(‘slow’) isnt working properly

 $(function() {
        $(".altbgcolor").live('mouseenter', function() {
              //hover code
              $(this)
                    .addClass('altbgcolor-active')
                    .find(".sharedp")
                    .slideDown('slow');
            }).live('mouseleave', function() {
              //stopped hovering code
              $(this)
                    .removeClass('altbgcolor-active')
                    .find(".sharedp")
                    .slideUp('slow');
            });
        });

Can someone please guide whats going wrong. You can see the demo of the problem at http://mashup2.sunnydsouza.com just scroll down the page and click ‘more’ button to fetch the new dynamic elements. They dont show the slideDown(), slideUp() effects 🙁

  • 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-24T16:05:52+00:00Added an answer on May 24, 2026 at 4:05 pm

    hover is troublesome when used with live(). Instead, use mouseover and mouseout. From the jQuery docs:

    As of jQuery 1.4.3, you can bind multiple live event handlers simultaneously by passing a map of event type/handler pairs:

    $(".altbgcolor").live({
      mouseover: function() {
        $(this)
            .addClass('altbgcolor-active')
            .find(".sharedp")
            .slideDown('slow');
      },
      mouseout: function() {
        $(this)
            .removeClass('altbgcolor-active')
            .find(".sharedp")
            .slideUp('slow');
      }
    });
    

    EDIT: in response to the request for help with demo – check the HTML you are inserting as part of the “More” button’s functionality. The new HTML does not contain the .sharedp div that your code is referencing, and appears to have been inserted a level too deep. Insert the correct HTML and the code will work.

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

Sidebar

Related Questions

I am using a jquery context menu plugin ( http://www.trendskitchens.co.nz/jquery/contextmenu/ ) which works fine
I have a sidebar list of links in my wikispace theme that currently uses
I am new to Ajax and have been following a tutorial from JQuery.com. I
I am developing a small web app that uses jQuery quite a lot. In
I have an img tag in my webapp that uses the onload handler to
I have a div which displays the current value of the slider and the
I am trying to display a page that uses jQuery. The AJAX functionality implemented
I cannot find out how to obtain destination element with jQuery UI sortable. $(#pages).sortable({
I've been tasked with implementing a Date/Time selector for several areas of our web
I'm using ASP.NET MVC and would like to get Model information for use within

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.