The place for more technical questions for those who want to create new pagetypes or bespoke functionality.

Fragment identifiers and scroll functions

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 1 mois #4578 par Neil Pollock
Fragment identifiers and scroll functions a été créé par Neil Pollock
I am using a scroll function in a bootstrap template to show a full page title screen for different sections. You can see this here:

xerte.cardiff.ac.uk/play_5683

However, if I give the link to a specific page the scroll function no longer works. For example:

xerte.cardiff.ac.uk/play_5683#page4

Does anyone have an idea why this would be?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 1 mois #4585 par Fay
Réponse de Fay sur le sujet Fragment identifiers and scroll functions
Hi Neil

Where have you put the code that controls the way that you want those titles screens to work (the code that makes it full screen but then shrinks it as you scroll down)?

Is it in one of the sections on the first page? If so then this won't have loaded when skipping directly to a later page so your title page won't work as expected.

There is a script optional property at LO level (click on 1st item in page tree where you've entered your LO title & add 'Script' optional property here). It may better when added here

Fay

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 1 mois #4586 par Fay
Réponse de Fay sur le sujet Fragment identifiers and scroll functions
Just thought - I think the LO level Script optional property might be a reasonably recent addition so if you don't have the option to add it here you might have to have the script in your 1st page duplicated on all subsequent pages to make sure it works when navigating directly to a page.

I hope this helps
Fay
Les utilisateur(s) suivant ont remercié: Neil Pollock

Connexion ou Créer un compte pour participer à la conversation.

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 1 mois #4587 par Neil Pollock
Réponse de Neil Pollock sur le sujet Fragment identifiers and scroll functions
Thanks for this, Fay.

The problem was indeed that I had the script on the first page and it wasn't being loaded (and as soon as you said it it seemed so obvious!).

I don't seem to have the script optional property at LO level yet, so I've just copied it across to the other pages as necessary.

Thanks.

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: JohnSmith
Temps de génération de la page : 0.149 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo