Last active
April 25, 2018 03:18
-
-
Save binary4cat/16f41a1ca3f0230431f58b9f26ec7de1 to your computer and use it in GitHub Desktop.
微信公众号文章页自动滚动到底部
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jumpScript = '<script>'+ | |
'function jumpIf(date=2000, jumpUrl=""){'+ | |
'var doc = document.all[0].innerHTML;'+ | |
'if( /<span[^>]*display\\:\\s*none[^>]*>\\.*?已无更多\\.*?<\\\/span>/i.test(doc) ){'+ | |
'document.body.scrollTop = document.body.scrollHeight - (document.body.clientHeight && document.documentElement.clientHeight);'+ | |
'setTimeout(jumpIf, date);'+ | |
'}else{'+ | |
'setTimeout(function(){window.location.href=jumpUrl}, date);'+ | |
'};'+ | |
'}'+ | |
'window.onload = function(){'+ | |
'jumpIf([#dateJump]);'+ | |
'}'+ | |
'</script>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment