JavaScript – Hide or Show an Element

Just about every site I’ve designed has made use of this code block. It utilizes a combination of JavaScript, CSS and some HTML DOM knowledge to get the job done.  Most often I use this to make dynamic menus however the uses are endless.  For this example I will use it for something more simple. [...]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
read comments

JavaScript – Auto Set Focus When Page is Done Loading

I use this block of code quite often. Almost every project I develop has a login page and I always toss this in to give it that subtle boost to the overall user experience. Once the page has loaded, the cursor location will automatically be set to the username field so the user doesn’t have [...]

Tags: , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
read comments

JavaScript – Creating Default Arguments

I ran into an interesting quirk with JavaScript yesterday, one I’m surprised I hadn’t noticed before.  JavaScript does not allow you to give arguments default values when defining functions.  So after a bit of tinkering, I came up with a solution. Of course you could use a ternary operator if you prefer, however I know [...]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
read comments
 Page 2 of 3 « 1  2  3 »