- Posts: 10632
- Thank you received: 3696
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Custom Template: New image at end of each group
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
10 years 10 months ago #95925
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Custom Template: New image at end of each group
I think the groups are assigned sequential numbers even if they are hidden by conditions.what if you have some confition in group ? Not sure the number is the same ?
Code:
$_gseq = -1; foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) { $gid = $gl['gid']; ++$_gseq;
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
10 years 10 months ago #95929
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 Custom Template: New image at end of each group
\o/ Great then !
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.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #95937
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
I implemented the CSS version and all works swimmingly. You guys rock.
There is one issue that I can't seem to resolve.
I want to use a placeholder image as described above, because...well...that makes sense. But, the placeholder image always shows...even when the group specific image loads. It seems to be "above" the group specific image, in Chrome anyway.
Any thoughts?
There is one issue that I can't seem to resolve.
I want to use a placeholder image as described above, because...well...that makes sense. But, the placeholder image always shows...even when the group specific image loads. It seems to be "above" the group specific image, in Chrome anyway.
Any thoughts?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
10 years 10 months ago #95954
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 Custom Template: New image at end of each group
If you use the css method
( CSS BACKGROUND IMAGES in first post of Tony)
There are no placeholder
No ?
( CSS BACKGROUND IMAGES in first post of Tony)
There are no placeholder
No ?
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.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #95986
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
Of course. Now all is well.
Thank you both.
David
Thank you both.
David
The topic has been locked.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #96002
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
Gents,
One more thing. Do you know of a preloader script that would be worthwhile to use?
Also, in what file would you put it?
Any advice you have would as always be appreciated.
One more thing. Do you know of a preloader script that would be worthwhile to use?
Also, in what file would you put it?
Any advice you have would as always be appreciated.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3696
10 years 10 months ago - 10 years 10 months ago #96018
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Custom Template: New image at end of each group
I have used this in the past:
(remember not to put a comma after the last image in the array)
Code:
$(document).ready(function(){ preload([ 'path/to/images/group_0.png', 'path/to/images/group_1.png', 'path/to/images/group_2.png', 'path/to/images/group_3.png' ]); }); function preload(arrayOfImages) { $(arrayOfImages).each(function(){ $('<img/>')[0].src = this; }); }
(remember not to put a comma after the last image in the array)
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 10 months ago by tpartner.
The topic has been locked.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #96034
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
In what file would you place it? At the end of template.js?
David
David
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3696
10 years 10 months ago #96038
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Custom Template: New image at end of each group
That would work or you could wrap it in a <script> tag and place it in the question source.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #96253
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
Hi Tony,
I have implemented the follwoing in the template.js.
$(document).ready(function(){
preload([
' www.mydomain.com/survey/upload/templates...roupDemo/group_0.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_1.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_2.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_3.png ',
]);
});
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
});
}
As you can see i included the full path to the images.Is it possible this is not the right approach. I ask because the images don;t seem to preload. There is a delay before they are presented on the page.
Is there a chance there is another setting that needs to be changed?
Any thoughts you have are most appreciated.
David
I have implemented the follwoing in the template.js.
$(document).ready(function(){
preload([
' www.mydomain.com/survey/upload/templates...roupDemo/group_0.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_1.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_2.png ',
' www.mydomain.com/survey/upload/templates...roupDemo/group_3.png ',
]);
});
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
});
}
As you can see i included the full path to the images.Is it possible this is not the right approach. I ask because the images don;t seem to preload. There is a delay before they are presented on the page.
Is there a chance there is another setting that needs to be changed?
Any thoughts you have are most appreciated.
David
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3696
10 years 10 months ago #96259
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Custom Template: New image at end of each group
Does the path contain "http://"? I don't see it in your code.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- dweisser
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 5
10 years 10 months ago #96260
by dweisser
Replied by dweisser on topic Custom Template: New image at end of each group
Yes, the http;// are all there; I'm not sure why I pasted the code without them.
" www.springboltconsulting.com/survey/uplo...roupDemo/group_0.png ",
I am asking, because I am working on another issue related to script and images, and am wondering if there is something I am making a fundamental mistake on.
Thank you,
David
" www.springboltconsulting.com/survey/uplo...roupDemo/group_0.png ",
I am asking, because I am working on another issue related to script and images, and am wondering if there is something I am making a fundamental mistake on.
Thank you,
David
The topic has been locked.