/    Sign up×
Community /Pin to ProfileBookmark

Java count Down Function

[B][U]SORRY FOR THE LONG EXPLANATION[/U][/B]
Right now I am using [B]IFrames[/B] and
on the timer page with a

[CODE][I][COLOR=”red”]HTML:[/[/COLOR]I] <meta http-equiv=”refresh” content=”10″>[/CODE]

and 1 image I am “stretching”

[CODE][I][COLOR=”Red”]PHP & HTML:[/COLOR][/I] <img src=”../images/timebox1.gif” style=”background-repeat:no-repeat;” alt=”” height=”13″ width=”<?php echo $_SESSION[‘timer’]; ?>” align=”top” border=”0″ />[/CODE]

It’s quite ugly especialy in IE8 and in Macs Safari (blinking, framebreaking etc)
I know it possible in Java to make a function on
the main site which can update my timer instantly:

[CODE][I][COLOR=”red”]PHP:[/COLOR][/I] $_SESSION[‘timer’]–;[/CODE]

when it reach 1 it redirect people to the Index page

[CODE][I][COLOR=”red”]PHP:[/COLOR][/I] if($_SESSION[‘timer’]==1) { $dat_update= mysql_query(“UPDATE Members SET online=’1′ WHERE memid=’$mid'”); $delay = ‘0’; $url = “../index.php”; echo ‘<meta http-equiv=”refresh” content=”‘.$delay.’;url=’.$url.'” target=”_top”>’; end; die; }[/CODE]

(Forced logout)
Where the session timer is reset to 60 again when the user logs in again.

[B]The use is following:[/B]
At login the session timer is set as default as 60 (equal to 6 minutes).
Every time the user does anything on the page the timer is reset to 60.
It count down every 10 sec ( where it makes the image 1 pixel smaller in the horizontal axel.
when it reach 1, it throw people out out on the main page.
the image is 13x1pixel but is stretch out to 13×60 pixels
and the done one pixel smaller every 10 sec.

is this possible in Java!!!

[CODE]function scrinktimer() {
What ever java
}[/CODE]

and the instead of the ugly iframe use

[CODE]<td a id=”scrinktimer()”></td>[/CODE]

there smoothly shrinks the image

??
Flemming

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@criterion9Jan 28.2010 — I think you are looking for the [I]java[B]script[/B][/I] forum not the Java forum.
×

Success!

Help @Pastoren spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...