Hot answers tagged

4

Use meaningful variable names (and element IDs), for example, startDateInput instead of input/myInput. Declare varables in the smallest needed scope instead all of them at the start of the function, and declare each variable in a separate statement. Use let or const instead of var (unless you need to support enviroments that don't support them). Move the ...


3

It has been a while since I worked with jQuery so I may not get specific API's correct. You are repeating ("slide", { direction: "left"}, 250), if you ever changed one of the properties I would assume you'd want them to be consistent with each other. You can set an array then destructure that when calling show or hide. You can also apply this theory to your ...


2

I wouldn't say the code is difficult to follow but I do have some suggestions. The first thing I notice is that some variables are declared with let. Many of those variables never get re-assigned. It is wise to use const for any value that shouldn't get re-assigned - even if it isn't a constant. This helps avoid accidental re-assignment. The values in ...


2

The first thing I'd do with the CSS is to replace all the absolute "px" units with relative units, either "em" or "%", as appropriate. (It really isn't good to make assumptions about the size of pixels on my screen.)


1

while your code runs, personally I would change the formatting to start with I noticed your search area div has a mistake in it, your H1 encloses the Anchor tag and the image but you close the H1 tag before closing the anchor tag, which is syntactically incorrect. I also noticed that you were missing quotation marks around the value of one of your anchor ...


Only top voted, non community-wiki answers of a minimum length are eligible