Skip to content

Commit

Permalink
Enhanced scroll reset
Browse files Browse the repository at this point in the history
  • Loading branch information
LoiueFragosoUwUr committed Apr 9, 2024
1 parent c587e4a commit b33ee42
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Gita-Storyline/storyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function showQuestion(){
let currentQuestion = question[currentQuestionIndex];
arjunaConversation.innerText = currentQuestion.Arjuna;
krishnaConversation.innerText = currentQuestion.Krishna;

initialize_scroll();
}
function initialize_scroll(){

Expand All @@ -87,14 +87,13 @@ left.addEventListener("click", () => {

currentQuestionIndex = (currentQuestionIndex - 1 + question.length) % question.length;
showQuestion();
initialize_scroll();

});

right.addEventListener("click", () => {
currentQuestionIndex = (currentQuestionIndex + 1) % question.length;
showQuestion();
initialize_scroll();

});

showQuestion();
Expand Down

0 comments on commit b33ee42

Please sign in to comment.