- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Loading Icon after clicking button to next question
- DanielFriedrichSchulz
- Topic Author
- Offline
- New Member
Less
More
6 years 7 months ago - 6 years 7 months ago #158620
by DanielFriedrichSchulz
Loading Icon after clicking button to next question was created by DanielFriedrichSchulz
Hi All,
I am trying to add a loading Window/icon to question with a long loading time but after trying myself it is not easy. I have used this code so far in "script/template.js:
But the Loading window just show up while the page is loading and after each question. I am trying to extend this period from the moment I click on the next button until the page is completely loaded. It would be great if you can help me.
Thank you very much
I am trying to add a loading Window/icon to question with a long loading time but after trying myself it is not easy. I have used this code so far in "script/template.js:
Code:
document.onreadystatechange = function () { var state = document.readyState if (state == 'complete') { setTimeout(function(){ document.getElementById('loading'); document.getElementById('probe').style.visibility="hidden"; },1000); } }
But the Loading window just show up while the page is loading and after each question. I am trying to extend this period from the moment I click on the next button until the page is completely loaded. It would be great if you can help me.
Thank you very much
Last edit: 6 years 7 months ago by DanielFriedrichSchulz.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
6 years 7 months ago #158622
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Loading Icon after clicking button to next question
The way is to :
Add a loading class to the body,
Remove this class with jquery ready function (best is to replace with loaded)
And add an element at start of your page show when body class name is loading, hide other element when class is loading.
Add the class when the page is unloaded.
See example in (old, not 2.5X compatible) SkeletonQuest
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L22
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L47
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L50
framagit.org/Shnoulle/SkeletonQuest/blob...-ui-custom.css#L1292
Denis
Add a loading class to the body,
Remove this class with jquery ready function (best is to replace with loaded)
And add an element at start of your page show when body class name is loading, hide other element when class is loading.
Add the class when the page is unloaded.
See example in (old, not 2.5X compatible) SkeletonQuest
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L22
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L47
framagit.org/Shnoulle/SkeletonQuest/blob/master/template.js#L50
framagit.org/Shnoulle/SkeletonQuest/blob...-ui-custom.css#L1292
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- DanielFriedrichSchulz
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
6 years 7 months ago #158643
by DanielFriedrichSchulz
Replied by DanielFriedrichSchulz on topic Loading Icon after clicking button to next question
Thank you very very much. You helped me a lot.
The topic has been locked.