D
D
danyfir2016-06-13 23:59:18
PHP
danyfir, 2016-06-13 23:59:18

How to make a condition when a certain id appears on the page?

How can I track whether the given id="###" appeared on the page or not?
Let's say I have blocks:
blah blah
blah
blah blah
They are dynamic, each appears in certain conditions.
I need that if id="1" appears, id="2" disappears
Roughly speaking:
if (id="3"-present)
{
take id="2" and add ' style="display"none" to it ' (or new class)
}
Please help me to do this in php.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
dev400, 2016-06-14
@dev400

isset() , but it's better to take js for this

E
entermix, 2016-06-14
@entermix

How to trigger an event in javascript

D
Dmitry, 2016-11-09
@kaktys123

I do not know if you use third-party libraries in the project. But if that appear.js verstaemvse.ru/scroll-plugin-appear-js.html it determines whether there is an element in view when scrolling. And I don’t understand something, should they appear and disappear when scrolling, or what?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question