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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:38:59+00:00 2026-06-04T20:38:59+00:00

Im using jQuery ui position plugin to set some helping boxes next to their

  • 0

Im using jQuery ui position plugin to set some helping boxes next to their previous elements, it works if I set the previous box id, but doesnt if I try to make it more dynamic and, for this, I need it to be dynamic. Lets see the code:

CSS

.helpBox {
    width: 150px;
    height: 75px;
    position: absolute;        
    display: block;
    right: 0;
    bottom: 0;
    background-color: #bcd5e6;
    text-align: center;
}

HTML

<asp:TextBox ID="txtInformation" runat="server" TextMode="MultiLine" Rows="5" CssClass="required" ClientIDMode="Static"></asp:TextBox>
<div class="helpBox">This is a helping box.</div>

Sorry for the asp.net code, its just a textbox.

JS

$(".helpBox").position({
    of: $("#txtInformation"),
    my: "left center",
    at: "right center",
    offset: "10 0"
});

And that works, but if I try to use this so I can reuse it and make it work with all the help boxes it doesn’t:

$(".helpBox").position({
    of: $(this).prev(),
    my: "left center",
    at: "right center",
    offset: "10 0"
});

Now I wonder how to make it work. That property is supposed to handle that but somehow it isn’t. Can anyone tell me what I’m doing wrong?

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-06-04T20:39:01+00:00Added an answer on June 4, 2026 at 8:39 pm

    You’re passing an object to the .position function. The object is being defined before it is passed to the function, so $(this).prev() will be evaluated in the context of the code that calls the method. this will not, necessarily, refer to your .helpBox here.

    However, if you iterated over your help boxes with $.each, then this at each iteration would refer to the actual box:

    $('.helpBox').each(function() {
       $(this).position({
         of: $(this).prev(),
         my: "left center",
         at: "right center",
         offset: "10 0"
       });
    });
    

    Demo

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

Sidebar

Related Questions

I'm using the jQuery positioning plugin from jQuery UI: http://wiki.jqueryui.com/w/page/12138026/Position Positioning works well enough
I am trying to get the current position using the jquery-ui-map (getCurrentPoistion), but iIkeep
I would like to create a gallery slideshow using Jquery Tools Scrollable plugin. But
I'm using jQuery Tools Plugin as image slider ( image here ), but due
I am using this script: http://wpaoli.building58.com/2009/09/jquery-tab-slide-out-plugin/ It works well but my problem is that
Using jQuery, when you set a blur event on a text box and set
I am using the jquery validate plugin, in combination with some custom field types
I'm using jQuery UI's datepicker control in a position: fixed toolbar at the bottom
I am using jQuery's scrollTo to make relative adjustments in the position of content
How do I check if browser supports position:fixed using jQuery. I assume I have

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.