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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:00:43+00:00 2026-05-20T05:00:43+00:00

I have a dynamically rendered div/span that needs to follow a particular component e.g.

  • 0

I have a dynamically rendered div/span that needs to follow a particular component e.g. a textbox. Currently it is set to a particular coordinate on the page and it is shown as appearing right beneath the textbox. But it no longer appears that way when a div above the textbox gets collapsed/expanded (i.e. it goes above/under the textbox).

Think of it as a search result area appearing under a search result box after clicking the search button, but the search result area moved when a random div above the search text box collapsed/expanded.

I’m pretty sure that a bit of javascript would fix this. I tried googling for it, but struggling to come up with decent keywords (and my search phrase didn’t really return me much).

The div/span in question is rendered in jQuery dynamically. I was wondering what does the quick solution look like?

Thanks.

  • 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-20T05:00:43+00:00Added an answer on May 20, 2026 at 5:00 am

    I “think” I understand your question… can you not wrap the textbox and div/span in another div and position that instead so it follows?

    A javascript solution is not very pretty as you’d have to re-position the “results” div every time another div was collapsed or anything changed on the page that would affect the position of the textbox. If that is what you want to do then you could use the offset() function.

    var myInputOffset = $('#MyTextBoxID').offset(); // Get the position of the input field relative to the document
    $('#MyDivID').css({top: myInputOffset.top + 50; left: myInputOffset.left }); // Position the div
    

    NB: The div should be positioned absolute and the 50 is an arbitrary number to shift it down lower than the input field.

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

Sidebar

Related Questions

I have a dynamically created image that I am saving to a stream so
I have a list of dynamically generated div-tags with a class-attribute but no id.
I have a page which dynamically loads a section of content via AJAX. I'm
I have a query that is dynamically built after looking up a field list
We have an engine that loads dlls dynamically (whatever is located in a certain
I have a link that I dynamically create which looks something like the following:
I dynamically have to call a Javascript after a tag is rendered. Is it
I have a UserControl ('AddressInfoGroup') within an updatepanel that dynamically loads user controls ('AddressInfo')
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I have a report viewer that is using form controls to dynamically pick and

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.