Js animation problem

clipboard.png

a.style.left = a.offsetLeft + 10 + "px";
div

console.log(a.style.left+"--"+a.offsetLeft)
a.style.lefta.offsetLeft

clipboard.png


flexstyle.left


clipboard.png
is still the same

Mar.05,2021

do you want to know the location of CSS?

it seems that the subject does not understand the role of these attributes of position display. When position is static, it will not work if you change left. Top right bottom left is not involved in the control of flex layout. If you want the element itself to participate in the flex layout and to animate the displacement of the element, transform should be the first choice. Transform is to make visual changes to the elements after layout, without affecting the layout and positioning itself.


offset is 205, isn't it 215 after adding 10? Both are the original values, and of course they will not change


numeric operations and strings should be separated as follows:

a.style.left = (a.offsetLeft + 10) + 'px'
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c3e4-2c2f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c3e4-2c2f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?