Friday, September 26, 2008

ScrollTop in IE

IE6 and DTD 4.01 requires you to use document.documentElement in stead of document.body, so u will need somthing like the below:

if (document.documentElement && !document.documentElement.scrollTop)
// IE6 +4.01 but no scrolling going on
else if (document.documentElement && document.documentElement.scrollTop)
// IE6 +4.01 and user has scrolled
else if (document.body && document.body.scrollTop)
// IE5 or DTD 3.2

Taken from this post

It was used in a very important fix in our code.

Monday, July 21, 2008

Remove duplicates from a List


Set set = new HashSet();
set.addAll(list);

// avoid overhead :D
if(set.size() < list.size()) {
list.clear();
list.addAll(set);
}

Friday, July 11, 2008

Create New Eclipse Workspace - With All Your Old Settings

If you want to create a new eclipse workspace and preserve all your settings,
simply copy the .metadata/.plugins/org.eclipse.core.runtime/.settings directory into your new workspace directory.
Here is a detaliled article Create New Eclipse Workspace - With All Your Old Settings