Trying to create a customized PACS viewer for scrolling through a series of CT head images.
However, encountering an issue with scrolling through all 59 images. Currently, able to scroll from the first to the 59th image, but struggling to loop back to the beginning when keeping the left mouse button clicked and moving the mouse upwards.
When left-clicking and dragging down, it scrolls only from image 1 to 59, and does not return to the first image when left-clicking and moving up. Any suggestions?
Here is the jQuery code:
$(document).ready(function() {
var lbDown = false;
$("#imgs").mousedown(function(e) {
if (e.which === 1) {
lbDown = true;
}
});
$("#imgs").mouseup(function(e) {
if(e.which === 1) {
lbDown = false;
}
});
$("#imgs").mousemove(function(e) {
if(lbDown) {
e.preventDefault();
$(this).find('img:visible').next().show();
}
});
});
A fiddle has been created as well: