I have been trying this also and can,t get it to work thought i had the right code.Please help

If you want fading effects for various elements on an html page then the jQuery javascript library is for you. The following example fades out and then fades back in all divs on a page that are clicked.

<html>
	<head>
    		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript">
        	$(function(){
            		$("div").click(function() {
                		$("div").fadeOut("slow", function() {
                    		$("div").fadeIn("slow");
                		});
            		});
        	});
        	</script>
	</head>

	<body>
		<div style="width: 400px; height: 400px; background: #CC0000; border: #000000"></div>
	</body>
</html>

Here's the javascript bit on it's own:

$(function(){
            $("div").click(function() {
                $("div").fadeOut("slow", function() {
                    $("div").fadeIn("slow");
                });
            });
        });

Of course it would help to know more precisely what your doing but in lieu of that there are some CSS3 things that will help specifically the new 'opacity' property.

However you will need to create several versions (one for each browser) because CSS3 is not properly out yet.
A cascading try/catch system should do the trick.

Or you could just use Jquery (I like to code everything myself then I know where I am with it).

This article has been dead for over six months. Start a new discussion instead.