| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
||||||||
|
||||||||
|
Below is the code needed to display count down in HTML page
using javascript. You define container for the count down (either <span> or <div> tag) and the initial value, and the code updates the time automaticlly in the format HH:MM:SS You can also control the style of the container using standard CSS, as demonstrated in the below and attached code. To activate the count down in one of your existing pages you have to follow two steps: 1. include the attached CountDown.js file with: Code:
<script type="text/javascript" src="CountDown.js"></script> 2. have such javascript in the <head> section: Code:
<script type="text/javascript">
window.onload=WindowLoad;
function WindowLoad(event) {
ActivateCountDown("CountDownPanel", 100);
}
</script>
where "CountDownPanel" is the ID of the container (i.e. you should have <span> or <div> with this ID) and 100 is the time in seconds to be counted. full source code: javascript Code:
html4strict Code:
Happy Programming! ![]() |
|
#2
|
|||
|
|||
|
my onmouseover doesn't work now
Hi Shadow Wizard,
I would like to use your code. It's cool. I have a question, though. I have a complicated multipage classic ASP, VB Script, SQL Server and Javascript web site. When I included your code - which works well! Thank you. - my mouse over stopped working. Here is the code I'm using for the mouseover: Code:
%>
<INPUT TYPE=BUTTON STYLE='font-size:10px;width:140px'
onClick="add_commodity(<% =RS("CommodityID") %>,'<% =Trim(RS("Commodity")) %>')"
VALUE='<% =Trim(RS("Commodity")) %>'
onMouseOver="writetxt('<% =Replace(msgtxt,"'","") %>')"
onMouseOut="writetxt(0)">
<%
I inherited this code and its a real mix of stuff with VB Script writing html. Do you know if there is something natively incompatible with your code (maybe the onload?) and onmouseover? I'm really at a loss as to where to start looking. Thanks, Chris |
|
#3
|
||||
|
||||
|
yes those lines are overwriting the window load:
Code:
window.onload=WindowLoad;
function WindowLoad(event) {
ActivateCountDown("CountDownPanel", 100);
}
if you already have onload code, you have to add this to my function. attach the whole page source code in zip file and I'll have a look - hopefully it will be something simple and quick. |
|
#4
|
|||
|
|||
|
zip file of our source
Hi ShadowWizard,
I am unable to attach all the source files. This web site is huge with multiple includes and intertwined code. In fact, you won't find the </BODY> in this file. It gets included down the stream someplace. I started over inserting your code to make sure I followed your directions precisely and ended up with the attached code. The words: "Time remaining" is displayed on the page, but the countdown numbers do not appear. The onmouseover DOES work with this version of the code. Thanks for your help, Chris |
|
#5
|
||||
|
||||
|
ok, in header.asp change those lines:
Code:
<script type="text/javascript">window.onload=WindowLoad;function WindowLoad(event)
{ ActivateCountDown("CountDownPanel", 100);}</script>
to be this: Code:
<script type="text/javascript">
window.onload=WindowLoad;
function WindowLoad(event) {
loadCookies();
ActivateCountDown("CountDownPanel", 100);
}
</script>
and this: Code:
<body onload="loadCookies();" MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0" RIGHTMARGIN="0"> to this: (remove the function from the body tag) Code:
<body MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0" RIGHTMARGIN="0"> |
|
#6
|
|||
|
|||
|
Timer
Hi!! I found your timer useful for my project. Thanks a lot. i have 1 question. After the message your time has expired i want it to go to a different page. please send me the codings for this to Thanks a lot Quote: |