jquery ui position with offsets not working
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the positioning examples in the linked JSFiddle and compare the results for #position2 and #position3. Trace the jQuery UI position behavior used by these calls; done means percentage and custom offsets produce the intended relative placement and the reported case is covered by a verified result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100