Lightbox vs Popup: the battle

Lightbox vs Popup: the battleSince the start, Bemba has used a Lightbox to show the ’share/save’ screen. A lightbox is simply a popup screen that stays inside the current window: it is not an actual new window. We found that this lightbox has too many drawbacks, so we are replacing it.

In the new Bemba, the lightbox will make place for a simple popup. Why?

  1. Popups are supported by every browser (read on how we deal with blockers)
  2. Lightboxes require the DOM to be loaded before they work
  3. We have a toolbar and bookmarklets, lightboxes don’t work for these
  4. In-line ajax validation is more complex in a lightbox than in a popup.

Other factors that made us decide to move away from the popup were the size of the external javascript file and the fact that there are just so many different versions, each with it’s own quirks. Some don’t work with Prototype, some require JQuery. Although we later discovered the Light Window Helper plugin which offers a great standard way to implement lightboxes in Rails, we decided to just skip the entire thing and move to a regular new window.

Instead of three different versions, there will now be just one with one type of validation.

A real challenge is to circumvent the built-in popup blockers which are present in all modern browsers. After some trial and error, Aaron and I discovered how they all work. Popups that immediately follow a click, are allowed. Even in IE7.

To be specific: there needs to be a window.open call inside an onclick handler for a link.

This is no problem for us at all. In fact, this is the default way to offer popups using the built-in url_helper in Rails. When you open popups like this, they are allowed in all browsers. We can even push more window-related calls to the popup without triggering any further warnings. For instance, I can push out a window.close() in an RJS response on the server, and it will work fine. This comes in quite handy, since it means I can deal with both success and error responses server-side.

0 Responses to “Lightbox vs Popup: the battle”


  1. No Comments

Leave a Reply




About Bemba Media

Bemba Media is a new social media company based in Amsterdam, the Netherlands. Founders Aaron Peters and Arne Dibbits are on a mission to offer people the easiest way to share their web experiences with friends and to discover what’s hot on the web right now.

The company launched Bemba.com in March 2008.

Bemba users share their favorite videos and websites on the social platforms they already use with their friends, like Facebook, Twitter and Hyves. More social networks and (micro-) blogs will follow.

Bemba will become a destination for 'funsurfing' the web, providing easy access to web content that people with similar interests have recently recommended to their friends.

Flickr photos

meeting with Sanoma NL in Hoofddorp #

Bemba blog in Wordle

More Photos

Twitter updates

    Recent readers