jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

jquery ui position with offsets not working

Open pezr opened this issue 3 years ago • 3 comments

Positioning with offset not working.

Example: CSS: #targetElement { height:300px; margin: 20px; border: dashed 1px #ee4455; background: #9cf; } .positionDiv { position: absolute; width: 75px; height: 75px; background: rgba(255,255,255,.3); border: dashed 1px #ee4455; }

HTML: <div id="targetElement"> 2 and 3 should be at the same position relative to 1 <div class="positionDiv" id="position1">1</div> <div class="positionDiv" id="position2">2</div> <div class="positionDiv" id="position3">3</div> </div>

JS: $( "#position1" ).position({ my: "center", at: "center", of: "#targetElement" }); $( "#position2" ).position({ my: "left+50% top+50%", at: "left+100% top", of: "#position1" }); $( "#position3" ).position({ my: "center center", at: "right top", of: "#position1" });

#position2 and #position3 should be at the same position relative to #position1 I know that left+50% = center but what if i want to use a different offset .

you can see the example in this fiddle

pezr avatar Jun 10 '22 23:06 pezr

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

mgol avatar Jun 22 '22 10:06 mgol

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

both 1.12.1 and 1.13.0

pezr avatar Jun 22 '22 16:06 pezr

Thanks for the report. Since the issue is already in 1.12, given limited team resources it's not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/. PRs are welcome if they're not too complex.

mgol avatar Jun 22 '22 20:06 mgol