我对我的投资组合正在开火,我使用了一个名为Gridly的wordpress主题,它使用masonry。我试图让帖子对齐到右侧而不是左侧。我碰到一个选项here,这将允许我通过使用“isOriginLeft”:false,但现在我只是不断收到此错误“未捕获的ReferenceError:砌体没有定义”,我没有更接近让帖子对齐正确。Uncaught ReferenceError:砌体未定义
我的投资组合是在这里:brittonhack.com/new/
jQuery是不是我的强项所以任何帮助将不胜感激。谢谢!
下面是不断产生错误的代码。
// masonry code
$(document).ready(function() {
$('#post-area').masonry({
// options
itemSelector : '.post',
// options...
isAnimated: true,
animationOptions: {
duration: 400,
easing: 'linear',
queue: false
}
});
});
// hover code for index templates
$(document).ready(function() {
$('#post-area .image').hover(
function() {
$(this).stop().fadeTo(300, 0.8);
},
function() {
$(this).fadeTo(300, 1.0);
}
);
});
// comment form values
$(document).ready(function(){
$("#comment-form input").focus(function() {
var origval = $(this).val();
$(this).val("");
//console.log(origval);
$("#comment-form input").blur(function() {
if($(this).val().length === 0) {
$(this).val(origval);
origval = null;
}else{
origval = null;
};
});
});
});
// clear text area
$('textarea.comment-input').focus(function() {
$(this).val('');
});
var container = document.querySelector('#post-area');
var msnry = new Masonry(container, {
itemSelector: '.post'
});
您不需要多个jQuery文档就绪函数,您可以将三者的逻辑组合成一个;虽然做好多个准备好的功能是合法的,但是看到你的代码的任何人都会感到困惑。 –
你在哪里引用'masonry'脚本? –