I want to be able to fix a element on the display and screen at the same position, but don't want to use position: fixed, as it causes problem to other elements. I want the element to be above other elements, so I have used z-index. Also, I want the element to be able to move from side to side, but not scroll across the display. The following is the code that I am working with:
<div style="position:relative;z-index:3;height:100%">
<div style="position:absolute;bottom: -460px;right:-30px;height:100%;">
<div style="position: sticky;top: 800px;">
<a class="btn btn-default dropdown-toggle" style="background-color:#00AF95;border-radius:50%;margin-left:100px;" data-toggle="dropdown" onclick="$('#floatingButton').toggle();" data-hover="dropdown" aria-expanded="true">
<i class="fa fa-plus" style="background-color:#00AF95;color:#f7f8fa"></i>
</a>
<div class="dropdown dropdown-inline" style="width:250px;display:block;bottom:80px;">
<ul class="dropdown-menu SMSUI" role="menu" id="floatingButton" style="display: block;">
<li class="dropdown" data-hover="dropdown" title="Send SMS to a Number"[enter image description here][1] onclick="(this.event.stopPropagation());">
<div id="numberDialerField" class="pad10R pad10L">
<input type="text" id="phoneCodeNumber" style="margin-left:10px;width:60px;" name="phoneCode" class="softphone-form-control" data-i18n="[placeholder]phonecode" placeholder="Ph. Code" value="">
<span>-</span>
<input type="text" id="telNumber" name="phoneNumber" class="softphone-form-control" data-i18n="[placeholder]label_phone_number" placeholder="Phone Number" value="" required="">
<div class="telFuncBtnDiv">
<span id="backspaceBtnSpan" class="cursor-pointer">
<i class="fa fa-check fa-xs"></i>
</span>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
For reference I have attached a sample image that helps understand the solution that I want, but not quite. I want the movable element to stay fixed and not move at all using position: sticky.
I want the Icon to stay at this position without position: fixed