doucang9673 2018-09-26 17:12
浏览 46

WP检查添加到html标记的特定类

In Wordpress is there any way to check if any specific class added to html tag of document? More Likely Modernzir (browser based) classes for enqueuing scripts etc.

<html class="queryselector svg cssall willchange audio canvas video adownload bgpositionshorthand cssremunit rgba csscalc cssgradients csschunit supports no-touchevents **no-cssscrollbar** cssvhunit cssvwunit formvalidation cssanimations appearance no-backdropfilter backgroundcliptext csscolumns csscolumns-width no-csscolumns-span csscolumns-fill csscolumns-gap csscolumns-rule csscolumns-rulecolor csscolumns-rulestyle csscolumns-rulewidth no-csscolumns-breakbefore no-csscolumns-breakafter no-csscolumns-breakinside no-cssgridlegacy cssgrid cssfilters flexbox shapes csstransforms backgroundblendmode fa-events-icons-ready wf-opensans-n4-active wf-active" lang="en-US">

For example if you check above code block, you can see that modernizr has added multiple classes based on browser compatibility. So i simply want to check if <html> has any specific class, for instance no-cssscrollbar to check if browser supports CSS3 scroll bar.

I tried different approaches including php class_exists() function, but no luck so far. I want to detect class without JS or jQuery approach.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效