Archive for the ‘Ajax’ Category

Simple Modal Div for Images, using prototype and scriptaculous

January 19, 2009david 1 Comment »

I know that everyone knows Lightbox JS and Lightbox JS 2 and frankly those 2 libraries works very nice. But let’s do something simplier using (also) prototype and scriptaculous.
Aligning vertically and horizontallya div.

This is very important and we can use it in many ways. First the css code:
 <style type="text/css">body, html {height: 100%; width:100%; margin: 0; [...]

read More »

Powerful tools for manipulating images using javascript

December 4, 2008david 1 Comment »

Surfing on Internet for a while, I found a wonderful toolbox. These are a compilation of several script to manipulate images. This is the list:
busy.js: The library allows you to add/remove loading indicators to block-level elements on your webpages.
shiftzoom.js: Allows you to add/remove zoom and pan functionality to oversized images on your webpages.
sphere.js: Simulates a [...]

read More »

Limit textarea length using javascript

November 13, 2008david No Comments »

This is a simple code, but useful.
First, the javascript function:
function limit(n,id){
// n is the number of max characters
// id is the id of the textarea element
text = document.getElementById(id);
if(text.value.length &gt;= n){
//alert("sorry, the text is too long");
text.value = text.value.substring(0, n-1);
}
}
Then, the [...]

read More »

Google Language API (AJAX)

October 20, 2008david 1 Comment »

On last march Google and their AJAX Search and Feeds team launched the Language API. This new API boasts two functions, language translation and language detection. Maybe the the most important function of this API is the Translation. Is very easy to use it.
To see more information about this API and learn how to use [...]

read More »

} catch(err) {}