Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Custom Template: New image at end of each group

Custom Template: New image at end of each group 1 Jahr 5 Monate her #95925

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
what if you have some confition in group ? Not sure the number is the same ?
I think the groups are assigned sequential numbers even if they are hidden by conditions.
        $_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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #95929

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6451
  • Dank erhalten: 844
  • Karma: 249
\o/ Great then !
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #95937

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Bronze Donor
  • Beiträge: 205
  • Dank erhalten: 5
  • Karma: 5
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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #95954

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6451
  • Dank erhalten: 844
  • Karma: 249
If you use the css method
( CSS BACKGROUND IMAGES in first post of Tony)

There are no placeholder

No ?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #95986

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Bronze Donor
  • Beiträge: 205
  • Dank erhalten: 5
  • Karma: 5
Of course. Now all is well.
Thank you both.
David
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #96002

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Bronze Donor
  • Beiträge: 205
  • Dank erhalten: 5
  • Karma: 5
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #96018

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
I have used this in the past:
$(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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Letzte Änderung: 1 Jahr 5 Monate her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #96034

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Bronze Donor
  • Beiträge: 205
  • Dank erhalten: 5
  • Karma: 5
In what file would you place it? At the end of template.js?
David
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #96038

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Custom Template: New image at end of each group 1 Jahr 5 Monate her #96253

  • dweisser
  • dweissers Avatar
  • OFFLINE
  • Bronze Donor
  • Beiträge: 205
  • Dank erhalten: 5
  • Karma: 5
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.189 Sekunden
Donation Image