Skip to content

Instantly share code, notes, and snippets.

@MizR
Created July 10, 2023 20:45
Show Gist options
  • Save MizR/57f1d8ee199cfe61877229d7646aa182 to your computer and use it in GitHub Desktop.
Save MizR/57f1d8ee199cfe61877229d7646aa182 to your computer and use it in GitHub Desktop.
Untitled
div {
max-width: 500px;
}
div img {
max-width: 100%;
}
<div>
<img src="https://dummyimage.com/400/400" width="1000" height="1000"/>
</div>
javascript:/*The%20Autoscroll%20Bookmarket:Tim%20Harper:http://tim.theenchanter.com*/var%20_ss_interval_pointer;_ss_speed=8;_ss_speed_pairs=[[0,0],[1,200.0],[1,120.0],[1,72.0],[1,43.2],[1,25.9],[2,31.0],[4,37.2],[8,44.8],[8,26.4],[16,32.0]];_ss_last_onkeypress%20=%20document.onkeypress;_ss_stop=function(){clearTimeout(_ss_interval_pointer)};_ss_start=function(){_ss_abs_speed=Math.abs(_ss_speed);_ss_direction=_ss_speed/_ss_abs_speed;_ss_speed_pair=_ss_speed_pairs[_ss_abs_speed];_ss_interval_pointer=setInterval(%27scrollBy(0,%27+_ss_direction*_ss_speed_pair[0]+%27);%20if((pageYOffset%3c=1)||(pageYOffset==document.height-innerHeight))%20_ss_speed=0;%27,_ss_speed_pair[1]);};_ss_adj=function(q){_ss_speed+=q;if(Math.abs(_ss_speed)%3e=_ss_speed_pairs.length)_ss_speed=(_ss_speed_pairs.length-1)*(_ss_speed/Math.abs(_ss_speed))};_ss_quit=function(){_ss_stop();document.onkeypress=_ss_last_onkeypress;};document.onkeypress=function(e){if((e.charCode==113)||(e.keyCode==27)){_ss_quit();return;};if(e.charCode%3e=48&&e.charCode%3c=57)_ss_speed=e.charCode-48;else%20switch(e.charCode){case%2095:_ss_adj(-2);case%2045:_ss_adj(-1);break;case%2043:_ss_adj(2);case%2061:_ss_adj(1);break;};_ss_stop();_ss_start();};_ss_stop();_ss_start();
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment