Home > Web Front-end > JS Tutorial > Relative parent element and relative document positioning sample code for jquery_jquery

Relative parent element and relative document positioning sample code for jquery_jquery

WBOY
Release: 2016-05-16 17:27:00
Original
1004 people have browsed it

Positioning is often used when developing jquery. Here are two types of positioning:

1. Positioning relative to the parent element: $("#ele").position(), and then get left = $("#ele ").postion().left right = $("#ele").postion().right
2. Relative document positioning: $("#ele").offset(), and then get left = $( "#ele").offset().left right = $("#ele").offset().right

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template