how to make some text in web page visible after 20 sec.

royal.prnvd

New Member
Messages
9
Reaction score
0
Points
0
i am new and i like to hide some text in webpage/html for atleast 20 sec. or 30 sec., and also timer should run like 20 19 18 17 ..... so that other know how much time is left,

and yes, this script do not reload the page, its just hide text and display when timer is off

---------- Post added at 01:43 PM ---------- Previous post was at 11:47 AM ----------

anyone help plzzz
 

VPmase

New Member
Messages
914
Reaction score
1
Points
0
Here is a quick script:
In your <head> tags put this:
Code:
<script>
function cDown(x, wrd){
if(x>0){
setTimeout(cDown(x-1, wrd), 1000);
} else {
document.getElementById('hideText').innerHTML = "Hidden word: " + wrd;
}
[code]
And put this in your body tag so it looks like
[code]<body onload="cDown('20', 'Mase is cool! :)';">

And have a div like this somewhere in the body:
Code:
<div id="hideText">20</div>


Now I haven't tested this since I just wrote in on the spot so you might have to do some debugging. if you need more help just reply to this post.
 

simon.evanz48

Member
Messages
32
Reaction score
0
Points
6
A really cool jQuery Plugin which enables you to visually control the appearance of your webpage elements or complete sections of your site, basically, any inline or block level tags.

The beauty of this plugin and jQuery as a whole is that you don't really have to get your hands dirty with DOM manipulation its pretty much taken care of with this library

The name of this fab plugin is called jQuery BlockUI Plugin (v2).

This may come in handy say for instance to block user activity for the page:

Code:
$.blockUI();

Blocking with a custom message:

Code:
$.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });

Blocking with custom style:

Code:
$.blockUI({ css: { backgroundColor: '#f00', color: '#fff'} });

To unblock the page:
Code:
$.unblockUI();


If you want to use the default settings and have the UI blocked for all ajax requests, it's as easy as this

Code:
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);

You may also find this demo section helpful too..
 
Top