对不起,我不是程序员。我正在为自己构建一个个人 WordPress 网站,我不得不编辑 php 文件,我遇到了这个问题。请有人帮我....
回答谢谢大家:D它的工作,有时我很惊讶我是多么愚蠢:P
萤火虫:
SyntaxError: missing } after function body
[Break On This Error]
...){ var $container = $('#portfolio'); //load with opacity if fade i...
代码:
jQuery(document).ready(function ($) {
var $container = $('#portfolio');
//load with opacity if fade in is off
if ($('#portfolio').attr('data-fade') != 1) {
$('#portfolio.portfolio-items .col.span_<?php echo $span_num; ?>').css('opacity', 1);
}
//else show the loading gif
else {
$('.container.main-content').before('<span id="portfolio-loading"><span>');
}
$(window).load(function () {
// initialize isotope
$container.isotope({
itemSelector: '.element',
filter: '*',
masonry: {
columnWidth: $container.width() / <? php echo $cols; ?>
}
});
//fade in
if ($('#portfolio').attr('data-fade') == 1) {
//fadeout the loading animation
$('#portfolio-loading').stop(true, true).fadeOut(300);
//fadeIn items one by one
$('#portfolio.portfolio-items .col.span_<?php echo $span_num; ?>').css('opacity', 0);
$('#portfolio.portfolio-items .col.span_<?php echo $span_num; ?>').each(function (i) {
$(this).delay(i * 150).animate({
'opacity': 1
}, 350);
});
}
});