Aymanshafei (Talk | contribs) (AFCM-Egypt/index) |
Aymanshafei (Talk | contribs) |
||
Line 56: | Line 56: | ||
moveToSelected('next'); | moveToSelected('next'); | ||
}); | }); | ||
+ | |||
+ | window.onscroll = function () { scrollFunction() }; | ||
+ | |||
+ | function scrollFunction() { | ||
+ | if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { | ||
+ | document.getElementById("myBtn").style.display = "block"; | ||
+ | } else { | ||
+ | document.getElementById("myBtn").style.display = "none"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // When the user clicks on the button, scroll to the top of the document | ||
+ | function topFunction() { | ||
+ | document.body.scrollTop = 0; // For Chrome, Safari and Opera | ||
+ | document.documentElement.scrollTop = 0; // For IE and Firefox | ||
+ | } | ||
+ | |||
</script> | </script> | ||
</html> | </html> |
Latest revision as of 13:26, 12 October 2017