I am working on simple creative where i want to scroll background image of div horizontally when cursor drag left or right.
So basically i have div of width 300px which have background image greater than div width. now whenever you drag or swipe image should move accordingly
Here is code:
<style>
.sprite-container {
width:300px;
float:left;
height:200px;
background-image: url("sprite.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
background-attachment:scroll;
overflow-x: visible;
overflow: visible;
}
</style>
<div class="sprite-container"></div>
Here is jsfiddle link for same : http://jsfiddle.net/janakprajapati90/gzLqspar/