Zurb Foundation 6不在Codeigniter上工作

时间:2016-03-06 16:05:01

标签: html css codeigniter zurb-foundation zurb-foundation-6

我目前正在Codeigniter上运行Foundation 5,它可以运行。现在我正在尝试安装不想工作的Foundation 6(the CSS version)。

我已经设置了一个名为<!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Foundation Starter Template</title> <?php echo link_tag('css/foundation-6/foundation.css?ver=1.1'); ?> <?php echo link_tag('css/foundation-6/app.css?ver=1.1'); ?> </head> <body> <h1>Hello, world!</h1> <script src="<?php echo base_url(); ?>js/foundation-6/vendor/jquery.min.js"></script> <script src="<?php echo base_url(); ?>js/foundation-6/vendor/what-input.min.js"></script> <script src="<?php echo base_url(); ?>js/foundation-6/foundation.js"></script> <script> $(document).foundation(); </script> </body> </html> 的简单页面,这里是代码(as illustrated here):

SyntaxError: class is a reserved identifier
class AccordionMenu {
foundation.js (linea 1751, col 2)

TypeError: $(...).foundation is not a function
$(document).foundation();
prova-foundation# (linea 16, col 7)

但我在Firebug中遇到以下错误(Firefox最新版本44.0.2):

<script>

基金会不起作用...... 所有cssapply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "jzdevelopers.ml.schoolbinder" minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' } } repositories { maven { url "https://jitpack.io" } maven { url "https://s3.amazonaws.com/repo.commonsware.com" } jcenter() } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:recyclerview-v7:23.2.0' compile 'com.android.support:cardview-v7:23.2.0' compile 'com.android.support:design:23.2.0' compile 'com.melnykov:floatingactionbutton:1.3.0' compile 'com.commonsware.cwac:richedit:0.5.2' compile 'org.sufficientlysecure:html-textview:1.4' compile ('com.github.NightWhistler:HtmlSpanner:0.4') compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') { transitive = true } compile('com.github.ganfra:material-spinner:1.1.1') { exclude group: 'com.nineoldandroids', module: 'library' exclude group: 'com.android.support', module: 'appcompat-v7' } compile('com.rengwuxian.materialedittext:library:2.1.4') { exclude group: 'com.nineoldandroids', module: 'library' exclude group: 'com.android.support', module: 'appcompat-v7' } } 链接都是正确的。如果我在浏览器中打开它们中的每一个,则会加载相应的文件。

我的网页出了什么问题? (i've set up a test page here

1 个答案:

答案 0 :(得分:1)

问题是您包含的foundation.js文件是用 ES6 编写的。在 Foundation 6.2 中,JavaScript已使用 ES6 重写。需要使用Babel将其转换为 ES5 才能在浏览器中使用。如果您正在下载CSS版本,则不应该这样做。这应该在它可供下载之前完成。

我已打开issue on GitHub以解决此问题。

在此问题得到解决之前,您需要选择以下两个选项:

  1. 复制并粘贴foundation.js文件here中的代码,然后将生成的,已编译的代码复制粘贴回foundation.js文件并保存。
  2. http://foundation.zurb.com/sites/download/下载完整版本,您可以获取已转换的foundation.jsfoundation.min.js文件。似乎基本下载已搞砸,但完整下载正在运行。