tutorial plugin

by Mike Gleeson

HTML

<div id='div1'></div>

<div id='div2'></div>

CSS

#div1{
    background-color:red;
    min-width:20px;
    min-height:20px;
    position:absolute;
    top:0px;
    left:0px;
    border-radius:30px;
    z-index:100;
}

#div2{
    width:50px;
    height:40px;
    background-color:green;
    position:absolute;
    top:10px;
    right:110px;
}

JavaScript

var position = $("#div2").position();
var div = $("#div1");
div.animate({top: position.top+'px', left: position.left+'px'}, 2000, function() {
    div.animate({padding: '5px'}, 2000, function() {
        div.text('hello world!');
    });  
});