Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
How to append a bootstrap dropdown with a div based on ID?

In my angular, I have a dropdown component. Here is how it looks like:

<div dropdown  placement="bottom left" #dropdown="bs-dropdown" [autoClose]="true" 
  [insideClick]="true" [container]="body">
  <a class="templates-icon" dropdownToggle (click)="toggleTextTemplates();">
    <i #one class="ic-text-templates" aria-hidden="true"></i>
  </a>
  <ng-container *ngIf="toggle" >
    <div *dropdownMenu class="templates-container dropdown-menu"
    role="menu" aria-labelledby="button-basic">      
  </ng-container>
</div>

Here in this example, container attribute is set to body and therefore the dropdown is bind with the body and visible top of each element.

Now let say I have three layer in my app. Layer-one, layer-two and layer-three and they are top of each other. Now I would like to display the dropdown only on layer-two (or imagine in middle layer). So I would like to bind this dropdown with layer-two based on id, so that drodown will be visible on top of layer one and two, but not the layer three:

<div id="layer-one"> 
  some element 1
  <div id="layer-two"> 
    some element 2
    <div id="layer-three"> some element 3</div>
  </div>
</div>

Can someone please give me an idea, or solution how I can achieve that?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Have you tried to just place the dropdown at layer 2? otherwise you can can use javascript like: getElementByID('#33').innerhtml

or make CSS index rules, where there is a attribute called index: (-1) or (1) etc. for the placement of the dropdown

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!