Copy link to clipboard
Copied
Hi!
I'm looking for navigation script that would do something like in Google image search, that you can either use side scroll bar to scroll down the thumbnail page, or use mouse wheel for scroll up down.
The part that open up extended menu with enlarged thumbnail after clicking on a thumbnail isn't really necessary at this point, but if script come with it that be really amazing.
Is there script like that out there?
Thanks in advanced.
Copy link to clipboard
Copied
This is a script I found, it's a scroll bar script. What I'm thinking is somehow to use mouse wheel to move ScrollDragger and trigger scrollDraggerPress.
I wonder if there is a listener that detect scrollDragger move to a new position and so it call scrollDraggerPress.
Or if there better option for me, please let me know too. thank you
// Scroll My Content function - AS3
function scrollMyContent () {
// Cache the TextField as a bitmap to improve performance.
content_mc.cacheAsBitmap = true;
// Event Listeners
scrollDragger.addEventListener(MouseEvent.MOUSE_DOWN, scrollDraggerPress);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpOnStage);
// Set variables
var scrollbarHeight:Number = scrollbarBG.height;
var contentHeight:Number = content_mc.height;
var scrollDraggerHeight:Number = scrollDragger.height;
var maskHeight:Number = contentMask.height;
var scrollAmout:Number = (contentHeight-maskHeight)/(scrollbarHeight-scrollDraggerHeight);
var topBound:Number = scrollbarBG.y;
var bottomBound:Number = scrollbarBG.height-scrollDraggerHeight+scrollbarBG.y;
var startPos:Number = content_mc.y;
var leftBound:Number = scrollbarBG.x;
var absNumSet:Number = 0;
// When scrollDragger gets pressed we do this
function scrollDraggerPress(event:MouseEvent):void {
// Set bounds using some of the scroller BG properties claimed above
var bounds:Rectangle = new Rectangle(leftBound, topBound, 0, bottomBound);
scrollDragger.startDrag(false, bounds);
stage.addEventListener(MouseEvent.MOUSE_MOVE, reportStageMouse);
function reportStageMouse(event:MouseEvent):void {
absNumSet = Math.abs(scrollbarBG.y - scrollDragger.y);
content_mc.y = Math.round(absNumSet * - 1 * scrollAmout + startPos);
}
}
// When mouse is released while dragging we do this
function mouseUpOnStage(event:MouseEvent):void {
stopDrag();
}
}
scrollMyContent();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now