Archive for the ‘Web Development – AJAX’ Category

 

jquery autocomplete wrong position

Tuesday, May 24th, 2011

jQuery autocomplete is very good tool. It works very well. The autocomplete drop down shows below textbox. But I faced issue when a fixed width assigned to body.
I fixed width of body in stylesheet as body{width:900px;} and it created issue for autocomplete. Autocomplete drop down has been placed some where else from the targetted text box.
To solve the problem I implemented following solution and it is working fine.

Edit jquery.autocomplete.js file.

find following code
show: function() {
var offset = $(input).offset();

this code is at around 702 line number

Add following code just below the code you found

var screenWidth = screen.width;
var bodyWidth = $(“body”).width();
if (screenWidth > bodyWidth)
{
var diff = (screenWidth – bodyWidth)/2;
offset.left = offset.left – diff;
}

With this code now jquery autocomplete drop down positioned horizontally properly even if width of the body is fixed. With 100% width there is no problem .

Adobe Spry framework for Ajax

Saturday, January 17th, 2009

The Spry framework for Ajax is a JavaScript library that provides easy-to-use yet powerful Ajax functionality that allows designers to build pages that provide a richer experience for their users. It is designed to take the complexity out of Ajax and allow designers to easily create Web 2.0 pages.

The Spry framework is a way to incorporate XML, JSON or HTML data into pages using HTML, CSS, and a minimal amount of JavaScript, without the need for refreshing the entire page. Spry also provides easy to build and style widgets, providing advanced page elements for end users. The Spry framework is HTML-centric, and easy to implement for users with basic knowledge of HTML, CSS and JavaScript. The framework was designed such that the markup is simple and the JavaScript is minimal. The Spry framework can be used by anyone who is authoring for the web in their tool of choice.

To see what is possible using Spry, check out the Spry home page, that show the Spry framework in action.

Site map | Blog
Copyright © 2008, COG IT Solutions Pvt. Ltd. All Rights Reserved
XHTML Validated