Javascript 弹性“U形网格”;未捕获类型错误:无法读取属性';toLowerCase';“未定义”的定义;
将个人和项目组合在一起,并尝试将Vu Khanh Truong的“弹性网格”jQuery插件用于实际组合。您可以查看它。问题在于,它似乎导致我的页面出现以下错误: 1)我有一个公文包部分的标题,当我加载运行插件的页面时,它会使我的标题消失。 2)应该有过滤按钮,这些按钮根据用于对内容进行分类的不同标签显示,而这些按钮不会显示。 3)它加载我正在使用的不同类别的预览缩略图,但当我单击它们时,它不会像预期的那样加载带有全尺寸图像(和描述)的模式。 在Chrome中打开控制台时,出现以下错误:Javascript 弹性“U形网格”;未捕获类型错误:无法读取属性';toLowerCase';“未定义”的定义;,javascript,jquery,portfolio,typeerror,elastic-grid,Javascript,Jquery,Portfolio,Typeerror,Elastic Grid,将个人和项目组合在一起,并尝试将Vu Khanh Truong的“弹性网格”jQuery插件用于实际组合。您可以查看它。问题在于,它似乎导致我的页面出现以下错误: 1)我有一个公文包部分的标题,当我加载运行插件的页面时,它会使我的标题消失。 2)应该有过滤按钮,这些按钮根据用于对内容进行分类的不同标签显示,而这些按钮不会显示。 3)它加载我正在使用的不同类别的预览缩略图,但当我单击它们时,它不会像预期的那样加载带有全尺寸图像(和描述)的模式。 在Chrome中打开控制台时,出现以下错误: 未捕获
未捕获类型错误:无法读取未定义的属性“toLowerCase”
我试图创建一个JSFIDLE来发布,以复制我遇到的问题,但我想JSFIDLE不允许您使用某些脚本或其他东西?”因为每当我尝试在页面上包含我正在使用的所有脚本时,控制台中就会出现MIME类型的错误
根据文档,我已经安装并正在使用该插件,但我并不擅长反构造Javascript,因此我无法理解为什么会出现这些错误:如果有人能帮忙,我将不胜感激
HTML
在Elastic_grid.js中搜索'if(numOfTag>1){ 在菜单中创建“一切”选项: createList(“config.something”); $。每个(项目标签、功能(I、I){ 创建列表(一) })" 并使用createList(“全部”)将行更改为粗体;尝试: 在elastic_grid.js中找到函数createList(文本) 并更改以下行:
[...]
function createList(text) {
var filter = text.toLowerCase().replace(' ', '-');
// This is a helper function that takes the
// text of a menu button and array of li items
if (text != '') {
var li = $('<li>');
var a = $('<a>', {
[...]
[…]
函数createList(文本){
var filter=text.toLowerCase().replace(“”,“-”);
//这是一个采用
//菜单按钮的文本和li项的数组
如果(文本!=''){
var li=$(“”);
变量a=$('
body {
background-color: #e1e1e1;
min-width: 430px !important;
}
/****** TOP NAVIGATION STYLES ******/
.navbar {
background-color: #f2f2f2 !important; /*#190c03*/
box-shadow: 0 1px 2px 2px rgba(0, 0, 0, 0.5);
}
.navbar-brand {
float: left !important;
height: auto !important;
transform: translateX(0);
opacity: 1;
transition: transform 0.4s, opacity 0.4s;
}
.navbar-brand:hover {
transform: translateX(25px);
opacity: 0;
transition: transform 0.4s, opacity 0.4s;
}
.navbar-right {
margin-right: 15px !important;
}
.navbar-header {
position: relative !important;
float: left !important;
width: 100% !important;
}
.navbar-toggle {
/* margin-top: 0px !important; */
}
.navbar ul {
float: right !important;
}
.nav-pills > li {
border: 1px solid rgba(0, 0, 0, 0.4);
background-color: #d8661A;
border-radius: 5px;
margin-top: 3.5%;
margin-right: 5px;
box-shadow: 0 4px 2px 0 rgba(0, 0, 0, 0.4);
transform: scale(1, 1);
transition: box-shadow 0.4s, transform 0.4s;
}
.nav-pills > li:hover {
transform: translateY(-5px);
border: 1px solid rgba(0, 0, 0, 0.7);
transition: transform 0.4s, border 0.4s;
}
.navbar-inverse .navbar-nav > .active > a {
background-color: transparent !important;
}
.nav-pills > li.active {
transform: translateY(-5px);
height: 50%;
border: 1px solid rgba(0, 0, 0, 0.7);
color: white !important;
background-color: #337ab7 !important;
transition: transform 0.4s, color 0.4s, background-color 0.4s;
}
.nav-pills > li a {
color: white !important;
border-bottom: 1px solid transparent !important;
transition: color 0.4s, border-bottom 0.4s !important;
}
.nav-pills > li.active > a:hover {
color: white !important;
}
/****** HEADER IMAGE STYLES ******/
.mast {
width: auto;
position: relative;
height: 600px;
margin-top: 7%;
margin-bottom: 2%;
/* box-shadow: 0 4px 2px 0px rgba(0, 0, 0, 0.7); */
}
/****** <SECTION> STYLES ******/
.secA, .secB {
width: auto;
min-height: 400px;
height: auto;
padding: 4% 10% 8%;
border-left: 1px solid rgba(255, 255, 255, 0.1);
border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.secA {
background-color: rgba(0, 0, 0, 0.4);
overflow: auto !important;
border-top: 1px solid rgba(0, 0, 0, 0.2);
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
.secB {
background-color: rgba(0, 0, 0, 0.2);
}
/****** ABOUT ME SECTION STYLES ******/
.me-left {
float: left;
max-height: 200px;
border: 5px solid black;
border-radius: 50%;
padding-left: 8px;
margin: 10px 10px 10px 0px;
background-color: white;
transform: scaleX(-1);
}
.me-right {
float: right;
max-height: 200px;
border: 5px solid black;
border-radius: 50%;
padding-left: 8px;
margin: 10px 0px 10px 10px;
background-color: white
}
/*********************************
**********sdFilterMe CSS**********
#sdfm-wrapper img,
.sdfm-overlay {
//Define the WIDTH of sdFilterMe Images
width: 200px !important;
//Define the HEIGHT of sdFilterMe Images
height: 200px !important;
border-radius: 7px;
overflow: hidden !important;
}
.sdfm-inner-wrapper {
border-radius: 10px;
margin: 5px !important;
}
.sdfm-overlay {
background-color: rgba(0, 0, 0, 0.7) !important;
color: white !important;
font-size: 0.35em !important;
text-overflow: clip !important;
}
.sdfm-overlay span {
padding: 5% !important;
margin: 8% auto !important;
max-width: 85% !important;
height: auto !important;
word-wrap: break-word !important;
border-radius: 2px !important;
}
*********************************/
/****** FOOTER STYLES ******/
.footer {
width: auto;
/* min-height: 150px; */
/*margin-bottom: 5px !important;*/
background-color: #1b1d1e;
padding: 1.5% 5%;
z-index: 3;
border-top: 1px solid red;
}
.footer-content {
/* border: 1px solid yellow; */
margin: 0 auto;
padding: 10px;
display: flex;
flex-flow: row wrap;
justify-content: center;
}
.footer-text {
font-size: 1.5em;
font-weight: normal;
color: rgba(255, 255, 255, 0.7);
/* border: 1px solid white; */
width: auto;
padding: 5px;
margin-left: 25px;
margin-right: 25px;
margin-top: 0.73%;
display: flex;
flex-flow: row wrap;
align-self: flex-start;
justify-content: center;
}
.footer-icons-box {
/* border: 1px solid red; */
width: auto;
padding: auto;
margin-left: 25px;
margin-right: 25px;
display: flex;
flex-flow: row wrap;
align-self: flex-end;
}
.sm-icon {
display: inline-block;
text-align: right;
}
.fa-circle {
color: rgba(255, 255, 255, 0.9);
transition: all 0.4s;
}
.footer-icons-box .fa-envelope,
.fa-twitter, .fa-free-code-camp, .fa-linkedin {
color: #1b1d1e;
transform: scale(1, 1);
transition: all 0.4s;
}
.footer-icons-box .fa-envelope:hover,
.fa-twitter:hover, .fa-free-code-camp:hover,
.fa-linkedin:hover {
color: #337ab7 !important;
transform: scale(0.8, 0.8);
transition: all 0.4s;
}
/* Begin 'scrollTo' */
$(document).ready(function() {
$('#topNav a').click(function() {
$.scrollTo(this.hash, 1200, {offset: -70}, {easing:'swing'});
return false;
});
});
/* End 'scrollTo' */
[...]
function createList(text) {
var filter = text.toLowerCase().replace(' ', '-');
// This is a helper function that takes the
// text of a menu button and array of li items
if (text != '') {
var li = $('<li>');
var a = $('<a>', {
[...]
[...]
function createList(text) {
// This is a helper function that takes the
// text of a menu button and array of li items
if (text != '' && text !== undefined) {
var filter = text.toLowerCase().replace(' ', '-');
var li = $('<li>');
var a = $('<a>', {
[...]