A
A
Alex-HAV2018-02-07 11:59:53
css
Alex-HAV, 2018-02-07 11:59:53

How to change the background of a div if it contains a link?

There is a drop-down menu on hover, cms generates links in it (messages, profile, exit) and when a person has notifications, another item is added (Notifications). This item has its own class and link.
How can I implement changes in the background of the area on which it is necessary to hover so that the menu drops out when this item with a notification appears in it.
Those. when there is notification the div changes its color.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Yanin, 2018-02-07
@Alex-HAV

It depends on what method this item is added. If it exists there during formation but is hidden, then jquery will cope with catching and exiting to the parent. If the DOM is already formed and this is some kind of ajax loading, then for good, you also need to add a class to the parent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question