Yes it is possible.
You would have 8 divs per image.
HTML:
<div class="imageContainer">
<div class"tl"></div>
<div class"t"></div>
<div class"tr"></div>
<div class"l"></div>
<div class"r"></div>
<div class"bl"></div>
<div class"b"></div>
<div class"br"></div>
<img src="myImage" />
</div>
CSS:
.imageContainer{
position:relative;
}
.imageContainer div {
position:absolute;
z-index:2;
}
.imageContainer .tl, .imageContainer .tr, .imageContainer .bl, .imageContainer .br {
z-index:3;
}
.imageContainer .t, .imageContainer .tl, .imageContainer .tr{
top: -20px;
}
.imageContainer .b, .imageContainer .bl, .imageContainer .br{
bottom: -20px;
}
.imageContainer .l, .imageContainer .tl, .imageContainer .bl{
left: -20px;
}
.imageContainer .r, .imageContainer .tr, .imageContainer .br{
right: -20px;
}
All you have to do now is to place an image sprite and set the width and the height.
Set the width and the height of the top left right and bottom with jQuery
GL