C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Find Control Location Using JavaScript


Posted Date: 13 Jun 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Abhijit Jana       Member Level: Gold
Rating:     Points: 10



Using the following code sample we can find any control postion .

We have to find the object name by Document.GetElementByID('Control') then use given code

function findControlPos(Controlobj)
{
var curleftPos = 0;
var curtopPos = 0;
if (Controlobj.offsetParent)
{
do {
curleftPos += Controlobj.offsetLeft;
curtopPos += Controlobj.offsetTop;
} while (obj = obj.offsetParent);
}
alert(curleftPos );
alert(curtopPos );

}




Responses

Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 1
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
Regards,
Kapil








Author: Abhijit Jana    17 Jun 2008Member Level: Gold   Points : 0
thanks


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to find the Control Location Using JavaScript
Previous Resource: Change the Background Colour of a Cell using Javascript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

it support

Contact Us    Privacy Policy    Terms Of Use