Skip to content

Commit 30c75b4

Browse files
authored
Scroll to top when loading a quiz question (#3104)
1 parent 6eeb6b9 commit 30c75b4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
significance: minor
2+
type: changed
3+
entry: Scroll to the top of the quiz UI area when a quiz question is loaded.

assets/js/llms-quiz.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,13 @@
760760

761761
$( document ).trigger( 'llms-post-append-question', $html );
762762

763+
var $quizUi = $( '#llms-quiz-ui' );
764+
if ( $quizUi.length ) {
765+
$( 'html, body' ).animate( {
766+
scrollTop: $quizUi.offset().top - 50
767+
}, 300 );
768+
}
769+
763770
},
764771

765772
/**

0 commit comments

Comments
 (0)