fork(1) download
  1. <div style="overflow: scroll; overflow-x: scroll; overflow-y: scroll; max-width: 150px; max-height: 150px;">
  2. <img id="img" src="http://t...content-available-to-author-only...k.club/wp-content/uploads/2015/11/spectrum_of_the_sky_hdtv_1080p-1920x1080.jpg" width="1920" height="1080"/>
  3. </div>
  4. <a href="#plus" onclick="plusimage();">[+]</a>
  5. <a href="#minus" onclick="minusimage();">[-]</a>
  6. <script src="https://c...content-available-to-author-only...y.com/jquery-1.11.3.js"></script>
  7. <script type="text/javascript">
  8. var maxwidth = 1920;
  9. var maxheight = 1080;
  10. var minwidth = 300;
  11. var minheight = 150;
  12. var img = $("#img");
  13. function plusimage()
  14. {
  15. var imgwidth = $("#img").width();
  16. var imgheight = $("#img").height();
  17. if(imgwidth < maxwidth)
  18. img.width(imgwidth + 40);
  19. if(imgheight < maxheight)
  20. img.height(imgheight + 20);
  21. }
  22. function minusimage()
  23. {
  24. var imgwidth = $("#img").width();
  25. var imgheight = $("#img").height();
  26. if(imgwidth > minwidth)
  27. img.width(imgwidth - 40);
  28. if(imgheight > minheight)
  29. img.height(imgheight - 20);
  30. }
  31. </script>
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
<div style="overflow: scroll; overflow-x: scroll; overflow-y: scroll; max-width: 150px; max-height: 150px;">
	<img id="img" src="http://t...content-available-to-author-only...k.club/wp-content/uploads/2015/11/spectrum_of_the_sky_hdtv_1080p-1920x1080.jpg" width="1920" height="1080"/>
</div>
<a href="#plus" onclick="plusimage();">[+]</a>
<a href="#minus" onclick="minusimage();">[-]</a>
<script src="https://c...content-available-to-author-only...y.com/jquery-1.11.3.js"></script>
<script type="text/javascript">
	var maxwidth = 1920;
	var maxheight = 1080;
	var minwidth = 300;
	var minheight = 150;
	var img = $("#img");
	function plusimage()
	{
		var imgwidth = $("#img").width();
		var imgheight = $("#img").height();
		if(imgwidth < maxwidth)
			img.width(imgwidth + 40);
		if(imgheight < maxheight)
			img.height(imgheight + 20);
	}
	function minusimage()
	{
		var imgwidth = $("#img").width();
		var imgheight = $("#img").height();
		if(imgwidth > minwidth)
			img.width(imgwidth - 40);
		if(imgheight > minheight)
			img.height(imgheight - 20);
	}
</script>