You have to move one ‘});’ of the bottom before the else:
//run the function for all boxes
$(".box").each(function () {
var thisBox = $(this);
var url = thisBox.href;
var infoBox = $(".info", thisBox);
thisBox.data('height', $(this).height());
thisBox.click(function () {
if (!thisBox.hasClass("opened")) {
thisBox.addClass("opened");
$("img", box).fadeOut("slow", function () {
infoBox.css({
"visibility": "visible",
"height": "auto"
});
infoBox.load(url, function () {
$('.readMore', thisBox).click(function (e) {
e.preventDefault();
var selector = $(this).attr('data-filter-all');
$('#container').isotope({
filter: selector
});
$('#container').isotope('reloadItems');
return false;
});
$('<a href="#" class="closeBox">Close</a>"').appendTo(infoBox).click(function (e) {
e.preventDefault();
$("html, body").animate({
scrollTop: 0
}, 500);
$('#container').isotope('reLayout');
});
var newHeight = infoBox.outerHeight(true);
thisBox.css({
"width": "692",
"height": newHeight
});
infoBox.animate({
width: 692,
height: newHeight
}, function () {
$('#container').isotope('reLayout', function () {
Shadowbox.setup();
thisBox.removeClass("loading");
infoBox.css({
"visibility": "visible"
});
var videoSpan = infoBox.find("span.video");
iframe = $('<iframe/>', {
'frameborder': 0,
'class': 'tide',
'width': '692',
'height': '389',
'src': 'http://player.vimeo.com/video/' + videoSpan.data("vimeoid") + '?autoplay=0&api=1'
});
videoSpan.replaceWith(iframe);
});
});
});
});
}
else {
$(".info").empty();
$("img", thisBox).fadeIn("slow");
thisBox.css("width", "230");
thisBox.height(box.data('height'));
thisBox.removeClass("opened");
};
});
});
3
solved missing ) after argument list else { – i can’t see it? [closed]