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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:10:22+00:00 2026-05-27T04:10:22+00:00

Core issue : http://jsfiddle.net/pipip/P46Xg/ I have a div container with a few paragraphs of

  • 0

Core issue : http://jsfiddle.net/pipip/P46Xg/
I have a div container with a few paragraphs of text,
and inside one of these paragraphs is the following anchor <a name="stop" />
The container is set to overflow:hidden

Is it possible with javascript / JQuery to set the height of the container so that the bottom of the container stops exactly at or below the anchor?

Added Depth & Background : http://jsfiddle.net/pipip/yj9dB/
This would be used for a modified JQuery Slider. Where someone using a CMS could type [readmore] anywhere into the Content field, which would be replaced by the above anchor via PHP. This way they would be easily able to control where the Read More break appears within the container. In the associated example I am hard-coding the height to 75px, although what I want is for the height to be dependent on the location of the anchor name="stop" in the text.

Thanks. If this is an awful way to go about it, I’m all ears!

  • 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-27T04:10:23+00:00Added an answer on May 27, 2026 at 4:10 am

    With jQuery you could do it like this:

    $('#container').height( $('a[name=stop]').position()['top'] );
    

    and CSS:

    #container {
        position: relative;
    }
    

    We need this because .position() gives us the position relative to an element’s offset parent, and we can make #container the offset parent of the anchor tag by setting its position to relative.

    JSFiddle: http://jsfiddle.net/divad12/RYPm7/1/

    Also, for HTML5, you may want to consider setting an anchor tag’s id attribute instead of name: HTML Anchors with 'name' or 'id'?

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

Sidebar

Related Questions

I have the following issue: A java object contains two arrays of core datastore
My Problem My core issue is I need to start the gnome-keyring-daemon from c
I am using Core Data and want a Text Label to display how many
If I run $res=imagecreatefromJPEG ('http://www.theweddingoutlet.com/core/media/media.nl?id=29428&c=697473&h=8320018df7b40ec6eff8'); I get False + error : gd-jpeg: JPEG library
In reference to this bug from Sonar: http://jira.codehaus.org/browse/SONAR-1865 and this one (which cross references
I've seen this kind of issue on SO (and on the Net overall) quite
Setup: ASP.net 3.5, Linq-to-Sql. Separate Web and DB servers (each 8-core, 8GB RAM). 4
You can see in this page: http://www.indiacustomercare.com/blogs/admin there is layout issue for some time
I wonder if any one could help me with the issue of HOW TO
I had an issue with mocking Apache Http client. The following attempt to create

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.