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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:52:42+00:00 2026-05-23T06:52:42+00:00

how to render a div next to href link, we are using JQuery. Below

  • 0

how to render a div next to href link, we are using JQuery.
Below is code attached where when clicked the div gets rendered just below the tab of browsers, I want to render next to that of href link as there will be lot of href links in the webpage using the same div tag.

I cannot do it in css because it gets fixed at that position and I am using the same div for many of the href in a page but changing the contents of the div dynamically upon the user who clicks the link.

Code attached.

Any help would be very helpful.

thanks.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

<script type="text/javascript">
      $(document).ready(function(){

      $('#cluster1').hide();

            $('a').click(function(){

            $('#cluster1').show('slow');

   });

   $('a#close').click(function(){
        $('#cluster1').hide('slow');
        })

      });
</script>

<style>

.heading {
background:none repeat scroll 0 0 #B8CFE6;
color:#333333;
font:bold 12px verdana;
padding:7px;
}

.fr {
float:right;
}

element.style {
display:block;
}
.cluster {
background:none repeat scroll 0 0 #FFFFFF;
border:1px solid #757893;
display:none;
left:80px;
position:absolute;
text-align:left;
top:0;
width:560px;
z-index:10000;
margin-left:100px;
}

body, div, ul, ol, li, h1, h2, h3, h4, h5, h6, form, input, button, textarea, p, td {
margin:0;
padding:0;
}

.content {
background:none repeat scroll 0 0 #FFFFFF;
font:11px verdana;
overflow:auto;
width:560px;
}

.bottom {
border-top:1px solid #C1C8D4;
font:11px verdana;
padding:7px;
text-align:right;
}
.fl {
float:left;
}

.content ul li {
float:left;
padding:5px;
width:170px;
list-style: none;
}
</style>

<div class="cluster" id="cluster1" style="display: block;"><div class="heading">
                    <div class="fr"><p><a href="#" id="close">Close</a></p></div>
                        Update
                </div>
                    <form method="post" action="">

                    </form>
                </div>

                </br></br></br></br></br></br></br></br>
                <a href="#" id="click">Click Here</a>
  • 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-23T06:52:43+00:00Added an answer on May 23, 2026 at 6:52 am

    You can get the link’s position with the .position() function. It will give you the element’s position relative to the offset parent (with .offset() you can get it relative to the document).

    Then you can simply use .css() on the div to position it.

      $('a').click(function(){
          var linkpos=$(this).position();
          $('#cluster1')
              .css('top', linkpos.top)
              .show('slow');         
      });
    

    jsFiddle Demo

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

Sidebar

Related Questions

i use such code, but it renders with error <li class=dd0><div id=dt1<a href=http://localhost:1675/Category/29-books.aspx>Books</a></div></li> there
I'd like to know how i can render a div clickable (like a link,
Is it possible to render empty <div style=width:50%> </div> with CSS in xHTML strict
I need to render quite alot (tens of thousands) images off-screen using OpenGL. I
Hello I have the next problem, I want to render the html of my
jQuery Mobile Docs says if we wrap form element in div containing data-role=fieldcontain proper
<a href=# onclick=return oamSubmitForm('display_form','display_form:link_prev'); id=display_form:link_prev> &lt; Prev</a> <a href=# onclick=return oamSubmitForm('display_form','display_form:link_next'); id=display_form:link_next> Next &gt;</a>
I'm using this code for my pagination, and I'd like the user's choice to
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying to create an appointment scheduler using jQuery (UI), Haml, and Rails. 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.