PDA

View Full Version : An extremely cool layer transition, step by step


filburt1
October 18 '02, 05:57 PM
Download the attached file in the post below this one and then view it in Internet Explorer. Cool, huh?

Here's how I did it (code from MSDN (http://msdn.microsoft.com/) and only works in late versions of IE):

<SCRIPT>
var startImage ="fruit.gif";
var endImage="mouse.gif";
var b = false;
function doTrans()
{
b = !b;
imgObj.filters[0].apply();
if (b)
{
imgObj.style.backgroundColor = "gold";
imgObjText.innerHTML = "First page<br>Another Line<br>Yet Another Line<br>Last Line" +
"<br>Just kidding, here's a really really long line!";
}
else
{
imgObj.style.backgroundColor = "skyblue";
imgObjText.innerHTML = "Second Page<br>Another Line<br>Yet Another Line<br>Last Line" +
"<br>Just kidding, here's a really really long line!";
}
imgObj.filters[0].play();
}
</SCRIPT>
<SPAN id=imgObj style="PADDING-RIGHT: 10px; PADDING-LEFT: 13px;
FILTER: progid: DXImageTransform.Microsoft.Pixelate(MaxSquare=50);
FONT: 9pt/1.3 verdana; WIDTH: 305px; COLOR: black; HEIGHT: 150px;
BACKGROUND-COLOR: skyblue"><DIV id=imgObjText><BR>
<B>First Page</B><BR><BR>Using the <B>apply</B> method prepares this SPAN element
for content changes.</DIV></SPAN><BR><BR>
<BUTTON onclick="doTrans()">Play Transition</BUTTON>

Clearly this is some advanced scripting and CSS so I can't explain every step, but change the blue and red text to what content you want. Any questions, just reply :)

filburt1
October 18 '02, 06:00 PM
File:

Gily
February 27 '03, 08:25 PM
How can i make this for the wellcome panel in Forumhome, i want to have it on my forum :)

filburt1
February 27 '03, 08:26 PM
Sorry but I'm not releasing it.

Gily
February 27 '03, 08:31 PM
no problem ;)

secern
March 17 '03, 04:43 AM
Wow thats really amazing :) most interesting .css scripting I've encountered, thanks alot for this :)

JR
March 17 '03, 07:48 PM
i agree, one of the best css scripts out there :laugh:, shame it doesn't work with all browsers :cry:

rjahrman
March 23 '03, 08:50 PM
awesome

smoseley
March 25 '03, 10:21 AM
filburt,

I'm impressed! Nice script! I'm gonna have to use something like that for HTMLOnly :-P

:)

sonic
March 26 '03, 10:30 PM
is there any way to use images instead of text?

l8er
sonic

filburt1
March 26 '03, 10:37 PM
Yes, I think any HTML will be used in the transition.

sonic
March 26 '03, 10:39 PM
well i used <img src=""> and replaced it over the text and i got an error.
dont i have to change"imgObjText.innerHTML" to something else?

l8er
sonic