Counter with a reset using Closures

Set up a basic counter with a closure and some externally accessible options.

Automatic text overwriting while typing

Well, maybe you are thinking that you can just turn on your “Insert” key from your keyboard but what If you don’t have it or if you want to always have an overwriting mode (independently) while typing in some specific “inputs” and “textareas”. You can do it easily.

Article about us in a national newspaper

Today has been published an article about us in a national newspaper.

newspaper-el-mundo-ihman

Virtual reality and control system made in the south of Spain (Málaga). It’s wonderful to have such a team 🙂

Here you can read the full article in spanish!

 

Infinite Scroll

Have you ever seen those automatic “load more” while you scroll down? Did you see them on Tumblr for images, Gmail for messages or Facebook? Cool, isn’t it? The infinite scroll is an alternative for pagination and it’s everywhere. It optimizes the user experience loading data as the user required it (indirectly). You get faster loading process for pages, web, apps and it just loads what you need instead of the whole bunch. You don’t need to add extra interactions, buttons or widgets because it comes with the normal reading behaviour that you are used to: scroll down with the mouse or with the finger in a touchable screen.

So, here how to do it in a simple pure JavaScript 🙂

createDocumentFragment vs innerHTML

DOM access takes a lot of time, you should think about this every time you are programming and optimize your code avoiding unnecessary access.

  • If you are going to insert a bunch/list of elements in the DOM and you want to show/insert them one by one, use createDocumentFragment, it’s the fastest way.
  • If you want to show/insert them all when they are ready, at the same time, use innerHTML, in this case it will be faster even than createDocumentFragment.

Never use innerHTML when you want to render one by one, it’s the slowest one (DOM access + creation).

If you want test it for your own and see the timing, run the code below with num: 10, 100, 500, 1500.