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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:36:48+00:00 2026-06-10T19:36:48+00:00

Working prototype: http://jsfiddle.net/ad5qa/K5fdZ/28/ For some reason when the more button is clicked the parentsUntil

  • 0

Working prototype:
http://jsfiddle.net/ad5qa/K5fdZ/28/

For some reason when the more button is clicked the parentsUntil is grabbing all divs in the page. I just want to get the div.htmlbox and have the height auto so I can see the full contents. Then click less to shrink it back down to 50px height. Any help would be greatly appreciated.

$('.morebox a').toggle(function() {
   var $this = $(this);
   var $parent =$this.parentsUntil('.htmlbox');

   $parent.height('auto')
   $this.text('less')
   $parent.css('border', '2px solid magenta')
   $this.css('border', '2px solid red')
}, function() {
   $parent.height('50px')
   $this.text('more')
});​

<h3>Description</h3>
<div class="htmlbox">
 This is a samle description that goes here with short or long content in this panel. If the text is higher than 50px then it should be hidden by the box. You must click expand to view the remaining content in the html box div. The float box is used to cut off the overflow of the content. 
<div class="fade-overlay"></div>
</div>
<div class="morebox">
    <img align="absmiddle" alt="more-less grabber" src="http://goo.gl/ho277">
    <a href="#" style="line-height: 10px">more</a>
    <img align="absmiddle" alt="more-less grabber" src="http://goo.gl/ho277">
</div>
  • 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-10T19:36:49+00:00Added an answer on June 10, 2026 at 7:36 pm

    If you only want that one element, then you wouldn’t use parentsUntil, you would use closest. However, .htmlbox is not an ancestor of your a at all. You will need to do something more complex. Additionally, you need to use this and not select all as.

    $this.closest(".morebox").prev();
    

    Note that this is highly dependent on your current html. If you change the structure you will need to modify this.

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

Sidebar

Related Questions

http://jsfiddle.net/nWqYL/2/embedded/result/ I've been working on fixing some issues with this prototype site. Myself and
I am working on using prototype to submit a simple login form: http://huddlee.homeip.net/danny/ For
I'm working on a new prototype for an application and I'm conducing some tests
Working with the Box2djs plugin here: http://www.crackin.com/dev/mms/physics/ ... and all I'm trying to do
I'm working on an inherited unfinished application that was using some prototype features for
Hello all! I'm working on a prototype that would require me being able to
question: I am working with jQuery sortable. I used this tutorial: http://www.xmech.net/programming/jquery-ui-sortable-tutorial/ Now this
I am currently working on a prototype ASP.NET MVC 3 solution that will be
This is what I have so far: http://jsfiddle.net/beCVL/5/ This is how I'm trying to
Hi! I have a working prototype of a game engine and right now I'm

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.