I've been researching all over for this, basically I have a table that displays "eco'texthere';' after posting the data.
How would I make the text fade in e.g. :
Table ---> User Send data using submit button ---> displays back message "rotating data" ---> Now text fades in saying "sucessfully sent". (Mostly using echo in PHP).
Will I need a timeout function and Jquery for this?
Yes, since this is a client-side effect I recommend you look into jQuery to do this, for example by using fadeIn
Yes - PHP is done executing by the time you're able to show the response to the user. You would want to take that PHP response (via AJAX), put it in a DOM element (like a div), and then animate that DOM element with jQuery once the AJAX call is complete.
you can use Mootools instead of jQuery:
You'll want to import a jQuery library like the fellows above recommended... Then you have something like:
$.get("yourphpscript.php",function(response){
$("#somediv").html(response).fadeIn('slow');
});
The div #somediv should start out with display:none;.
I found this working for me if un wanna use javascript:
<head>
<!-- Javascript -->
<script type="text/javascript">
function showHideLayer(id){
e = document.getElementById(id);
if(e.style.display=="block"){
e.style.display = "none";
} else {
e.style.display = "block";
}
}
</script>
</head>
<body>
<!-- Link zum Anzeigen/Verstecken -->
<a href="alternativeLink" onclick="showHideLayer('myLayer');return(false)">Hide/Show</a>
<div id="myLayer" style="display:none;">
My hidden layer
</div>