Вот мой кодКак я могу изменить край изображения, которое внутри DIV
<head>
<style>
/* Spritesheet is 2000 x 400 and has 5 frames horizontally */
.crop {
width: 400px;
height: 400px;
overflow: hidden;
}
.crop img {
width: 2000px;
height: 400px;
margin: 0px;
}
</style>
</head>
<body>
<div class="crop">
<img id="pic" src="spritesheet.png" />
</div>
</body>
</html>
И я хочу, чтобы изменить край изображения с идентификатором pic
в -400px
с функцией.
с помощью javascript, а не CSS –