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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:09:26+00:00 2026-05-25T14:09:26+00:00

I am sure this is a pretty easy answer, but I have been pulling

  • 0

I am sure this is a pretty easy answer, but I have been pulling my hair out trying to get this thing to work.

What I’m trying to do is to create a learn more button on some text boxes. When you click on learn more, the box should expand down and show more information.

Where I am running into trouble is actually making the learn more click function correspond to the specific text box that it’s next to… It’s expanding all of the text boxes and not the specific one I want.

There is also a functionality in there to animate the background with the color plugin.. I already have that working.. Just targeting the specific boxes is driving me crazy.

I can add the click function to .bind, but I can’t use this to target anything.

$(document).ready(function(){
    var service = $(".service"), text = $(".service-text, h1.service-heading"); 

    $('.learn').bind({
    mouseenter: function() {
            $(service).animate({ backgroundColor: "#000000", }, 800);
            $(text).animate({ color: "#FFFFFF", }, 800);
        },
    mouseleave: function() {
            $(service).animate({ backgroundColor: "#FFFFFF", }, 800);
            $(text).animate({ color: "#000000", }, 800);
        }
    });
});

UPDATE:

Here is the HTML I am using

<div class="service box-round">
<h1 class="service-heading">WEB DEVELOPMENT</h1>
    <div class="service-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<span class="more-info">...Click for more info</span></div>
    <div class="more-text">More Text</div>
</div>
            <div class="learn"><span class="more">learn more</span><span class="less">learn less</span></div>

My thought was to use a hide and show function for the learn more and learn less.

  • 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-25T14:09:26+00:00Added an answer on May 25, 2026 at 2:09 pm
    $('.learn').bind({
    mouseenter: function() {
                $(service).animate({ backgroundColor: "#000000", }, 800);
                $(text).animate({ color: "#FFFFFF", }, 800);
    },
    mouseleave: function() {
                $(service).animate({ backgroundColor: "#FFFFFF", }, 800);
                $(text).animate({ color: "#000000", }, 800);
    }  
    });
    

    this part can be changed to:

    $('.learn').hover(function() {
        service.css({ backgroundColor: "#000000" });
        text.css({ color: "#FFFFFF" });
    }, function() {
        service.css({ backgroundColor: "#000"});
        text.css({ color: "#FFFFFF" });
    });
    

    why i’m not using the animate – because jQuery without plugins can’t animate the background and input text color

    update:

    I don’t know if it’s what you are looking for, but: http://jsfiddle.net/DJLZC/7/

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

Sidebar

Related Questions

Pretty sure there is an easy answer to this, but just can't find the
I'm pretty sure this is some stupid mistake from me but i haven't been
I'm pretty sure this will be a really easy answer for you jQuery whizzes,
I'm sure that this is pretty easy to do but I'm not sure how
Im pretty sure the answer must be quite easy, but for some reason I
So I'm pretty sure i already know the answer to this, but does the
I'm sure this is a pretty easy fix, but I'm not sure why my
I think that this should be pretty easy but I'm not quite sure how
I am pretty sure this might not be an easy task, but here goes:
I'm pretty new to Javascript and I'm sure this is an easy fix, but

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.