/    Sign up×
Community /Pin to ProfileBookmark

Timing an alert

Hello guys,
I’m a researcher in psychology and I would like to set up a study on cooperation. To control the most parameters as possible, I’d like to present some screenshots after definite delays to make the participant think that it’s the answer from the other participants.

What as been coded so far is that the participant write his real text, then an alert pops up to ask him to wait for the answer. He have to click the alert’s button, then he have to wait for 5 seconds to see another alert saying that the second participant has answered. It’s quite ok but not ideal.

My two questions are :
* can I present a gif (as a timer) instead of the first alert using an “OnClick” command? (i’m sure it’s possible but I still havent found how to atm)
*
if so, can I time this gif to dissapear after a while (5 seconds) to make the alert appear ? or if we can’t present a gif with an OnClick command, can I time the first alert to make it dissappear by itself after a while (so they won’t have to click on that one)

Thanks a lot for your comments, ideas or solution.
Kind regards, grib.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@web_bertOct 24.2009 — You can use a modal to display the image, if you don't want them to be able to click anything else. You can then use window.setTimeout to hide the modal after 5 seconds. eg:

[CODE]

thingToClick.onclick = function(){

//code to show modal here

window.setTimeout( function(){

//code to hide modal here

}, 5000 );

};

[/CODE]
×

Success!

Help @grib 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.19,
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,
)...