I am trying to use jQuery's position method to obtain the position of a div. The div has default property for the position property. For some reason it returns Object {top: 0, left: 0}
The HTML for the particular div is shown below:
<div class="col-xs-3" id="increased-width">
<div id="standards">
<label><strong>My Energy Standards</strong></label>
<a class="btn" data-toggle="modal" data-target="#energyStandardModal"><span class="glyphicon glyphicon-info-sign"></span></a>
<br />
</div>
<div id="years">
<h5><strong>My Study Periods (in years)</strong></h5>
<div id="col-1" class="altStudyPeriod"></div>
<div id="col-2" class="altStudyPeriod"></div>
<div id="col-3" class="altStudyPeriod"></div>
<div id="col-4" class="altStudyPeriod"></div>
</div>
</div>
The jQuery code is also shown here:
$(document).ready(function () {
standardDiv = $("#standards").position();
console.log(standardDiv);
});
I also tried using the offset() method but it returns the same values. However, this particular is not located at the origin of the webpage (0,0)