First of all, thank you to anyone who takes the time to look at this. Second, apologies if this is elementary stuff. Anyway here's the issue: On the menu page of my portfolio site (www.henrykember.com), there are buttons that hide and reshuffle item thumbnails based on whether they're day-to-day work ("9-5") or side projects ("5-9"). To show everything again, you click "all". Clicking these buttons changes the css ("margin-top", margin-left"), so "5-9" items that are normally further down the page come up to the top when all the "9-5" stuff is hidden. But there's a glitch: when clicking "5-9", then "all" (in that specific order), someo of the "5-9" items don't return to their original css. These aren't actual buttons, just clickable list items. Is that a problem? Here's my js:
$(document).ready(function() {
var fivetonine = $("#fivetonine");
var ninetofive = $("#ninetofive");
var all = $("#all");
var business = $(".business");
var casual = $(".casual");
fivetonine.on('click', function () {
casual.show(200);
business.hide(200);
$("a#subsub").css("margin-top", "200px");
$("a#housework").css("margin-top", "160px");
});
fivetonine.off('click', function () {
business.show(200);
casual.show(200);
});
ninetofive.on('click', function () {
business.show(200);
casual.hide(200);
$("a#archive").css("margin-top", "500px");
$("a#subsub").css("margin-top", "930px");
$("a#housework").css("margin-top", "1170px");
});
ninetofive.off('click', function () {
business.show(200);
casual.show(200);
});
all.on('click', function () {
business.show(200);
casual.show(200);
$("a#subsub").css("margin-top", "930px !important");
$("a#housework").css("margin-top", "1170px");
$("a#archive").css("margin-top", "1790px");
});
all.off('click', function () {
business.show(200);
casual.show(200);
});
});