Skip to content

Commit

Permalink
Merge pull request #8 from contentauth/scroll-to-top
Browse files Browse the repository at this point in the history
JS not needed for scroll to top with CAI styling
  • Loading branch information
crandmck authored Oct 26, 2023
2 parents 2be50cb + b7df007 commit e37915b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions js/cai-customscripts.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
window.onload=function() {

// Scroll-to-top button
const top_scroll_buttons = document.getElementsByClassName("top-scroll-btn");
for (let i = 0; i < top_scroll_buttons.length; i++) {
// When the user clicks on the button, scroll to the top of the document
top_scroll_buttons[i].addEventListener("click", function() {
console.log("top_scroll_button clicked!")
window.scrollTo(0, 0);
});
}

all_property_desc = document.getElementsByClassName("prop_desc")

//for (let i = 0; i < all_property_desc.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion pages/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
{% for term in schema.definitions %}

{% if include.layout=="cai" %}
<button class="top-scroll-btn" title="Go to top">Scroll To Top</button>
<a class="top-scroll-btn" title="Go to top" href="#manifeststore">Scroll To Top</a>
{% endif %}

### {{term.first}}
Expand Down

0 comments on commit e37915b

Please sign in to comment.