jQuery 位置

jQuery 位置html

// 默認窗口
$(window)

// 查看、指定標籤上下滾輪的位置數
$('#id').scrollTop()

// 設置、指定標籤上下滾輪的位置數
$('#id').scrollTop(100)

// 查看、指定標籤左右滾輪的位置數
$('#id').scrollLeft()

// 設置、指定標籤左右滾輪的位置數
$('#id').scrollLeft(100)

// 指定獲取標籤在html中的座標位置以數組打印
$('#id').offset()

// 獲取指定標籤在html中的上座標位置
$('#id').offset().top

// 獲取指定標籤在html中的左座標位置
$('#id').offset().left

// 獲取指定標籤相對父標籤的座標位置
$('#id').position()
相關文章
相關標籤/搜索