skip to Main Content

using a javascript code I can add a script into document that will load a feedier widget into my page.
This widget is into a

<div class = 'feedier-widget__container'></div>

I would like to put this div upon another div

<div class = 'btn_dwld_1'></div>

Is there some code I could use to authomatically overlay these two divs instead of using CSS?
Thank you

2

Answers


  1. Try using : The Dialog element. Hope this helps
    Dialog

    Login or Signup to reply.
  2. One possible way to do that is to use the insertBefore or insertAfter methods, which insert a node before or after another node as a child of a parent node. For example, you could use this code to insert the feedier-widget__container div after the btn_dwld_1 div:

    let feedier = document.querySelector(".feedier-widget__container");
    feedier.style.position = "absolute";
    feedier.style.zIndex = "1";
    feedier.style.top = "0";
    let btn = document.querySelector(".btn_dwld_1");
    btn.style.position = "relative";
    let parent = btn.parentNode;
    parent.insertAfter(feedier, btn);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search