May 21, 2009

Jcrop plugin for image crop in jQuery

Jcrop is a cross-browser jQuery image crop plugin, a quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine..







Some features of Jcrop:

* Attaches simply to any image in your HTML page
* Supports aspect ratio locking
* Callbacks for selection done, or while moving
* Keyboard support for nudging selection
* Support for CSS styling
* Advanced API including animation support

An example of this plugin here & a sample PHP code to complete the server-side of the crop here.

Requirements: jQuery
Compatibility: All Major Browsers
Website: http://deepliquid.com/content/Jcrop.html
Demo: http://deepliquid.com/content/Jcrop_Examples.html

May 15, 2009

Solved problem with setAttribute () in javascript

This week i faced a problem with setAttribute() in javascript, i used this to set a border for an <li> tag when the particular image is clicked.
i used like this,

var LiObj = document.getElementById('img_1');
LiObj.setAttribute("style", "border: 2px solid red;");

this one perfectly works in Mozilla Firefox (since the setAttribute works fine in FF). Same opposite in IE, IE does not support setAttribute(). At this stage what i will do?

i modified the above code like this,

var LiObj = document.getElementById('img_1');
LiObj.style.border = '2px solid red';

This is an simple issue when we look at outside, when there is an deadline on any project this small design issue can trouble your head to lose the hair.

try like this tweaks to fix the browser compatible.

May 08, 2009

Brendan Eich Father of Javascript


Brendan Eich (born 1961) is a computer programmer and creator of the JavaScript programming language. He is the Chief Technology Officer at the Mozilla Corporation.