who can tell me what is different between style.left and element.offsetLeft , is it the same?
style.left
element.offsetLeft
element.offsetLeft Returns the number of pixels that the upper left corner of the current element is shifted to the left within the offsetParent node.
elem.style.left This property is a property from left from style attribute
elem.style.left
You can set style.left - it is user-defined and can even remain empty, and offsetLeft always read-only and always has its current position.
offsetLeft
element.offsetLeft returns the distance from the left edge of the node to the parent node in pixels.
style.left is the CSS style for the node and can be in any of the following formats: CSS block formats
style refers to css rules, while the other refers to the actual offset of the element relative to the parent, regardless of whether the positioning is caused by css or something else, just like another object, span or something else.
style
style.left is the left position from the viewport, while element.offsetLeft is the offset position to the left of the outer parent element
Source: https://habr.com/ru/post/945974/More articles:Validating properties using System.ComponentModel.DataAnnotations.Validator - c #Efficient bucket sorting on GPU - synchronizationWhat does the following C macro do? - cAndroid setX () and setY () behave strangely - androidjQuery - Scrolling function continues to run: only once - javascriptWhy is the C ++ perspective and new project options not available in Eclipse? - c ++perl subroutine argument lists - "pass by alias"? - pass-by-referenceWorking with VirtualKey on Windows 8 with C # Applications - windows-8How can I generate salt and confirm_token records for displaced users using FOSUserBundle - mysqlwindows phone 8.1 text code virtualKey symbol validation - c #All Articles