Is it expected that my script runs this slow?
I have added a small script to a wordpress site, being developed locally inside a LAMP-stack.
It's just a few lines, the entire file is what you see below. From when the html+css is drawn in the browser (current FF and Chrome) it takes about ½ second until I see the new script-inserted margin-bottom having its effect.
I thought this small change would be applied without the eye noticing it.
Is it normal that it takes such a long time?
- var setThumbMargin = function () {
- var calendarItemMargin = jQuery('.calendar-item:nth-of-type(2)').css('margin-left');
- jQuery('.calendar-item').css("margin-bottom", calendarItemMargin);
- };
- jQuery(document).ready(function () {
- setThumbMargin();
- });
- jQuery(window).resize(function () {
- setThumbMargin();
- });