iPhone Click Event Delay

It appears that the iPhone has a built-in delay of about 300ms before firing the click event. This is most likely to give the user time to make a gesture, such as scrolling the page. In some cases, though, this may not be desired. For instance, if you make a mobile web app that doesn’t scroll, there’s no reason to wait 300ms every time the user clicks.

In these cases, the trick is to use ontouchstart instead of onclick.

  • Share/Bookmark

,

No Comments

Understanding Pointers in JavaScript

Pointers can sometimes be a confusing topic. In JavaScript, it is perhaps even moreso than in other languages. The confusion arises because the var keyword is serving double duty. It is used to define variables, as is commonly realized. But it is also used to make references– or point to– other variables, functions and properties. Read the rest of this entry »

  • Share/Bookmark

No Comments

Using the Amazon ECS Gem In Your Rails App

Amazon.com offers a tremendous amount of web services to developers looking to display their products. They benefit from this because developers make all sorts of cool apps for browsing Amazon. For example, nifty 3D Flash experience CoolIris (formerly known as ‘PicLens’) added Amazon functionality to their product. It’s a win-win for developers and Amazon because it drives traffic to the site while paying developers referral fees. Read the rest of this entry »

  • Share/Bookmark

, ,

1 Comment

Best of 2009, Ruby on Rails Edition

It was a good year for Rails. In 2009, we saw a number of exciting developments and a lot of great tools were released. Rails 2.3 was released in March 2009 and met with much fanfare. Rails has seen the introduction of templates, engines and a lot of other great features. Read the rest of this entry »

  • Share/Bookmark

,

2 Comments

Best Homepages of Top Interactive Agencies

RPA*

rpa

Organic

organic

Razorfish

razorfish

Read the rest of this entry »

  • Share/Bookmark

No Comments

Javascript 1.8 forEach – supported in Safari, Firefox and beyond

If you don’t have to support IE, you can start taking advantage of JavaScript 1.8 features such as the forEach construct. It’s nicer than a conventional for loop when you are iterating over every item in an array. Read the rest of this entry »

  • Share/Bookmark

No Comments

Random Integer Javascript snippet

returns a random number between two digits passed in as arguments.

function randomInteger(low, high)
{
    return low + Math.floor(Math.random() * (high - low));
}
  • Share/Bookmark

No Comments

Scrolling to an element when outside of the viewport with prototypejs

Often times you’ll have be playing, say, videos with a list of videos down the page. If the list gets too long the video player becomes out of sight as the user scrolls down. This can be a big confuser to users: they click on a link to see a video and they don’t see anything happen because the video player is out of sight. Here’s what you can do: scroll to the video player if it is out of sight like so:

if ($("videoplayer").viewportOffset()[1] < 0) {
 Effect.ScrollTo('videoplayer', {duration: 0.2});
}

Requires both prototype and effects.js in scriptaculous.

  • Share/Bookmark

No Comments

Grab last item in XSLT for-each

This is simple and fun!

Here’s an example of doing something in all instances EXCEPT the last one. Reversing this is obvious:

 

Often times you want a horizontal rule in all instances except the last item. You can also use this method for adding a class name to the last item:

  • last
    • Share/Bookmark

    No Comments

    Best Way to Get Gmail in Ruby on Rails

    Gmail is not as easy as sendmail, unless you have this tutorial. This gem/tutorial is by far the best solution.

    action_mailer_tls

    There are a lot of solutions out there so it can be hard to know which to choose. I have tried many and found this to be dead simple. Takes 5 minutes to setup.

    • Share/Bookmark

    No Comments