A
A
artyglitch2020-10-08 10:03:30
PHP
artyglitch, 2020-10-08 10:03:30

Execute a callback after changing the style attribute via JS on an element?

There is a block, through JS style.display is changed to 'block'. After changing the display property, you need to call the function.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2016-01-28
@s1mp1e

Create a .htaccess file (this is how the file should look like, i.e. without a name, just an extension), in the root of the site and write AddDefaultCharset UTF-8 into it

V
Vladimir Dubrovin, 2016-01-28
@z3apa3a

<meta charset="utf-8">
should be

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

L
Leo Mavrin, 2020-10-08
@artyglitch

So what's the problem?
You wrap style.display in a function and call callback() in it

function elementShow(callback){
  style.display
callback()
}

elementShow(() => {
   //та самая callback функция
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question