Friday, September 3, 2010

How to create flashy effects for webpages

When you entered this page, you probably noticed that the screen dissolved from the previous one to the actual page. Nothing was wrong with your computer, it was the work of the new Flashy Introduction META tag. This tag, unfortunately, is only compatible with IE4+, but provides a great effect (and allows normal viewing in Netscape). The META tag is very easy to insert, once you know how to use it. This is the script:
<META http-equiv="Page-Enter" content="revealTrans(Duration=#,Transition=#)">
You will need to change two parts of this code. First, you will need to change the blue # after Duration to the number of seconds that you want the Flashy Introduction to take. Then, you will need to change the blue # after Transition to the number of the type of transition that you want the Flashy Intro to do. A list of what each number in Transition does is provided below. Once you make those two, small changes, insert the tag in the HEAD of your page.
The Transition # list:

    0   - Shrinking Box Changes Screen 1   - Growing Box Changes Screen 2   - Shrinking Circle Changes Screen 3   - Growing Circle Changes Screen 4   - Wipes Up to Clear Screen 5   - Wipes Down to Clear Screen 6   - Wipes Right to Clear Screen 7   - Wipes Left to Clear Screen 8   - Right Moving Stripes Clear Screen 9   - Downward Moving Stripes Clear Screen 10 - Right Moving Boxes Clear Screen 11 - Downward Moving Boxes Clear Screen 12 - Pixels "Dissolve" screen 13 - Horizontal Curtain Closing 14 - Horizontal Curtain Opening 15 - Vertical Curtian Closing 16 - Vertical Curtian Opening 17 - Strips away previous screen going Left-Down 18 - Strips away previous screen going Left-Up 19 - Strips away previous screen going Right-Down 20 - Strips away previous screen going Right-Up 21 - Horizontal Bars "Dissolve" screen 22 - Vertical Bars "Dissolve" screen 23 - Random Effect
A full example:
<META http-equiv="Page-Enter" content="revealTrans(Duration=5,Transition=21)">

How to open a new console when someone enters or leaves your site

You've probably seen this on some web sites. When you enter the site, but more frequently when you leave the site, a console pops up with some additional info or ads, or a poll etc. This can be done using Java script.
To Open A Console When Someone Enters Your Site:
<script language="JavaScript">
<!--
window.open('http://www.freewebmastertips.com','HB','toolbar=1, location=1,status=1,menubar=1, scrollbars=1,resizable=1, width=500,height=300');
// -->
</script>

Just place the above code within the BODY tags.
To Open A Console When Someone Leaves Your Site:
Place the following attribute in the <body> tag: onunload="leave()"
For example:
<body bgcolor="#000000" onunload="leave()">
Place the following code between the "</head>" and <body> tag.
<script language="JavaScript">
<!--
var exit=true;
function leave()
{
if (exit)
open("http://www.freewebmastertips.com",'HBexit','toolbar=1,location=1, status=1,menubar=1,scrollbars=1,resizable=1, width=500,height=300');
}
// -->
</script>

Now you will have a console popping up everytime you leave the site. So make sure you use the below attribute in the <a href> tag on links to avoid the exit console from popping up on sponsors and other links where this is not desired.
onclick="exit=false"
For example:
<A HREF="http://www.anydomain.com" onclick="exit=false">
NOTE: Make sure you keep the long string of codes intact; if you break them, they won't work (and that's why this page is different also). To customize the codes, replace the URL in red with the one of your choice. Oh, don't overdo this because your visitors will get annoyed.