Category Archives: Javascript

javascript, js

RequireJS + Zurb Foundation

Javascript Snippet: Play next video

There is a requirement from one of my project to insert video ads before the actual video gets played. There are ways to do it, one is to use JWPlayer and OVA plugin, or the other way is to write your own javascript to control the playback. In the following demo, shows how you can… Read More »

How to extend JQuery UI plugin

The existing dialog plugin doesn’t have an option to close dialog on clicking modal overlay, how to add an option to provide the functionality?

Google Map v3 OverlayView Code Sample

Today I was writing some google map javascripts and had to implement the icons via OverlayView class, so I think I might share it in case anyone need some sample code.

A tip for event function within a loop, function closure

When I was writing some javascript at work a while ago, I encountered a problem, see below:

When I click the element, it always returned 9, because the event function is not included into the context until it is triggered, therefore, while the click function is triggered, the variable “i” is already 9 (after… Read More »