Skip to content

Instantly share code, notes, and snippets.

@bga
Created August 8, 2010 18:08
Show Gist options
  • Save bga/514354 to your computer and use it in GitHub Desktop.
Save bga/514354 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!-- code has grubbed from http://msdn.microsoft.com/en-us/library/ms532990(VS.85).aspx -->
<html>
<head>
<title></title>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<SCRIPT>
var bToggle = 0;
function fnToggle() {
oDiv.filters[0].Apply();
// After setting Apply, changes to the oDiv object
// are not displayed until Play is called.
if(bToggle)
{
bToggle = 0;
//oDiv.style.backgroundColor="gold";
oDiv.style.visibility = '';
//oDiv.filters[1].Opacity = 100;
}
else
{
bToggle = 1;
//oDiv.filters[1].Opacity = 0;
oDiv.style.visibility = 'hidden';
oDiv.style.backgroundColor="blue";
}
oDiv.filters[0].Play();
}
</SCRIPT>
</head>
<body>
<BUTTON onclick="fnToggle()">Toggle Transition</BUTTON><BR/><BR/>
<DIV ID="oDiv" STYLE="height:250px; width:250px; background-color: gold;
filter:progid:DXImageTransform.Microsoft.Fade(duration=2);
">
Hello!
</DIV>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment