faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 10 people (60%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How+can+you+aply+an+IE+filter+to+a+page+when+the+window+loses+focus+and+take+it+off+onfocus%3F

Apr 6th, 2008 19:14
ha mo, Dave Pedowitz, David Furman,


The following uses the alpha filter and applies an opacity of 20 onblur 
and restores the opacity onfocus:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>Untitled</title>
<script langauge="JavaScript">
function applyFilter(num) {
	var filter = "alpha(opacity=" + num + ")";
	document.body.style.filter = filter;
}
</script>
</head>
<body onFocus="applyFilter('100')" onBlur="applyFilter('20')">
Stuff goes here all da time
</body>
</html>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com