Skip to content

Simple image viewer, written in javascript and css

License

Notifications You must be signed in to change notification settings

reinefjord/sivjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sivjs

Simple image viewer, written in javascript and css.

As the name implies, it is very simple: put images in a div with an id, include the script and stylesheet, and pass the id and whatever ratio you would like the viewer to have (e.g. 16/9) to the init function. The viewer will expand to 100% width.

<link rel="stylesheet" href="siv.css">

<div id="container">
  <img src="image1.jpg">
  <img src="image2.jpg">
  <img src="image3.jpg">
</div>

<script src="siv.js"></script>
<script>
  init('container', 16/9);
</script>