M
M
Max Darkleviathan2021-06-24 01:53:36
JavaScript
Max Darkleviathan, 2021-06-24 01:53:36

How to stop movement of offset.left element?

There is this block:

How can I stop it moving to the right at a certain amount?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dubrovin, 2021-06-24
@darkleviathan

The basic construction that is studied at the 2nd stage after the variables.
if - condition that accepts bool

if(true){
Выполняем код
}
if(false){
Не выполняем код
}

In your case
if(текущее значение "величины" < "величины" на которой происходит остановка){
Выполняем действие
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question