jQuery: JSDoc'd coordinates and added test suite

Added interface to cover coordinates definition.
This commit is contained in:
johnnyreilly
2014-01-01 16:05:06 +00:00
parent 6baada500f
commit 925a1282a8
2 changed files with 39 additions and 3 deletions
+15
View File
@@ -1669,6 +1669,21 @@ function test_width() {
});
}
function test_coordinates() {
var p = $("p:last");
var offset = p.offset();
p.html("left: " + offset.left + ", top: " + offset.top);
$("*", document.body).click(function (event) {
var offset = $(this).offset();
event.stopPropagation();
$("#result").text(this.tagName +
" coords ( " + offset.left + ", " + offset.top + " )");
});
$("p:last").offset({ top: 10, left: 30 });
}
function test_hide() {
$('.target').hide();
$('#clickme').click(function () {