Created
August 25, 2014 22:32
-
-
Save caseypugh/03f8e27945fd945db54d to your computer and use it in GitHub Desktop.
Package scrolling bg select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var total_height = 2000 | |
var container_height = 300 | |
var package_height = 35 | |
var container_ypos = 0 // starting at top | |
// value between 0 and 1 | |
var scrollbar_pos = container_ypos / (total_height - container_height) | |
var selected_package = Math.floor(container_ypos + (container_height * scrollbar_pos)) / package_height) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment