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 page that is mostly rendered through json data. The url passes
I have a page composed from multiple partial asp.net mvc views rendered dynamically. How
I have a dynamically created image that I am saving to a stream so
I have a dynamically generated rss feed that is about 150M in size (don't
I'm working on a web page where I have a dynamically generated table where
I have code that dynamically load 10 different textfields in viewdidload method now if
I dynamically have to call a Javascript after a tag is rendered. Is it
I need to dynamically set which id a JavaScript call uses, as I have
I have an <asp:CheckBoxList> using RepeatLayout=Flow in my page I dynamically assign values to.
I have an application that dynamically draws a chart onto a winform. Both the

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.