[英]How to add css properties to a div class based on another child div class?
I have to apply below CSS only when this div class is available 我仅在此div类可用时才在CSS下应用
dhx_list_item dhx_list_day_events_item dhx_list_item dhx_list_day_events_item
.dhx_view .day_events .dhx_scroll_cont:first-of-type:before {
//some code here
}
Pls find the attached. 请找到附件。
With jquery, you could try something like this: 使用jquery,您可以尝试执行以下操作:
if ($('#child').length) {
// manipulate the parent
$('#parent').addClass('dhx_view');
}
$('#child').length
will evaluate to false
if none of the child div
s are present. 如果没有任何子
div
,则$('#child').length
计算结果为false
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.