9lessons programming blog
Loading Search
9lessons Bring Friends
Wall Script
Follow Me:
Wednesday, May 27, 2009

Draggable with jQuery from Google Ajax Libraries API.

Implement jQuery element draggable() form Google Ajax Libraries API it simple just some lines of code take a look at livedemo.
Google host providing frequently used javascript files eg. jQuery, Mootools, Dojo. Use google.load() to speedup your website loading.


Download Script     Live Demo

Javascript Code
Contains google ajax api code loading jquery form libraries google.load();
<script src="http://www.google.com/jsapi?key=AB">
</script>
<script type="text/javascript" >
google.load("jquery", "1");
google.load("jqueryui", "1");

function OnLoad(){
$('#content').html('<div id="drag-div" ">' +
'<div id="dragme"></div></div>');
$("#drag-div").draggable({
"handle": "div"
});
}

google.setOnLoadCallback(OnLoad);
</script>

<body>

<div id="content">Loading...</div>

</body>

CSS Code
#dragme
{
width:229px;
height:129px;
background:url(dragmelogo.png) no-repeat;
border:4px solid #666666
}

Related post:

Perfect Javascript Form Validation using Regular Expressions.
Comments
{ 2 comments }
Anonymous said...

Change the title.

vorda said...

doesn`t work in IE8...(?)

Post a Comment