关闭Zurb Foundation 5元标签 [英] Turn off Zurb Foundation 5 meta tags

查看:143
本文介绍了关闭Zurb Foundation 5元标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

搜索整个互联网,但没有找到任何有关它。
如何在< head> 中关闭zurb基金会5个元标记:

 < meta class =foundation-mq-small> 
< meta class =foundation-mq-small-only>
< meta class =foundation-mq-medium>
< meta class =foundation-mq-medium-only>
< meta class =foundation-mq-large>
< meta class =foundation-mq-large-only>
< meta class =foundation-mq-xlarge>
< meta class =foundation-mq-xlarge-only>
< meta class =foundation-mq-xxlarge>
< meta class =foundation-data-attribute-namespace>


解决方案

1)它们是一些Foundation的JS插件所必需的。
$ b 2)如果您只想使用Reveal Modal,则不需要移除这些元标记。您只需将此插件添加到您的网站即可:

 < script src =/ js / foundation.js> < /脚本> 
< script src =/ js / foundation.reveal.js>< / script>

或者,如果您使用 foundation.min.js $ b

  $(document).foundation('reveal');你可以只启动这个插件:




<3>如果您完全有信心因某种原因想要移除这些标签,您有三种可能性:

编辑文件 foundation.js

从文件 foundation.js 中删除​​此部分。

  header_helpers([
'foundation-mq-small',
'foundation-mq-small-only',
'foundation-mq-medium',
'基金会-mq-medium-only,
'foundation-mq-large',
'foundation-mq-large-only',
'foundation-mq-xlarge',
'foundation-mq-xlarge-only',
'foundation-mq-xxlarge',
'foundation-data-attribute-namespace']);

通过纯JavaScript删除(包含后)



在您的网站中包含代码片段somwhere。它应该在Foundation初始化后运行。

  var metas = document.getElementsByTagName('meta'); 
for(index = metas.length - 1; index> = 0; index--){
var metaClass = metas [index] .getAttribute('class')|| ; (metaClass.indexOf('foundation')> -1){
metas [index] .parentNode.removeChild(metas [index]);
if





$ b

jquery移除(包含后)



这段代码片段需要jQuery,但是,您应该已经包含它,因为Foundation依赖它。当然,它也应该在Foundation初始化后运行。

  $('meta [class * = \'foundation \']')。去掉(); 


Searched all over the internet but could not find anything about it. How can I turn off this zurb foundation 5 meta tags in <head>:

<meta class="foundation-mq-small">
<meta class="foundation-mq-small-only">
<meta class="foundation-mq-medium">
<meta class="foundation-mq-medium-only">
<meta class="foundation-mq-large">
<meta class="foundation-mq-large-only">
<meta class="foundation-mq-xlarge">
<meta class="foundation-mq-xlarge-only">
<meta class="foundation-mq-xxlarge">
<meta class="foundation-data-attribute-namespace">

解决方案

1) You shouldn't. They are needed for some Foundation's JS plugins.

2) If you want to just use Reveal Modal, you don't need removing these meta tags. You can simply include only this plugin into your webstie:

<script src="/js/foundation.js"></script>
<script src="/js/foundation.reveal.js"></script>

Or, if you are using foundation.min.js, you can init only this plugin:

$(document).foundation('reveal');

3) If you are absolutely confident you want to remove these tags for some reason, you have three possibilities:

Editation of file foundation.js

Remove this part from the file foundation.js.

header_helpers([
   'foundation-mq-small',
   'foundation-mq-small-only',
   'foundation-mq-medium',
   'foundation-mq-medium-only',
   'foundation-mq-large',
   'foundation-mq-large-only',
   'foundation-mq-xlarge',
   'foundation-mq-xlarge-only',
   'foundation-mq-xxlarge',
   'foundation-data-attribute-namespace']);

Removal by plain JavaScript (after include)

Include thit code snippet somwhere into your website. It should be run after Foundation initialization.

var metas = document.getElementsByTagName('meta');
for (index = metas.length - 1; index >= 0; index--) {
  var metaClass = metas[index].getAttribute('class') || '';
  if (metaClass.indexOf('foundation') > -1) {
    metas[index].parentNode.removeChild(metas[index]);
  }
}

Removal by jQuery (after include)

This code snippet needs jQuery, however, you should have it included already because Foundation depends on it. And, of course, it should be also run after Foundation initialization.

$('meta[class*=\'foundation\']').remove(); 

这篇关于关闭Zurb Foundation 5元标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆