Closed (fixed)
Project:
Better Select
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2009 at 18:21 UTC
Updated:
20 Sep 2013 at 17:21 UTC
This is a UI enhancement for long lists of terms. Here is the jQuery to accomplish this (add within Drupal.behaviors.initBetterSelect):
// Scroll to first checked term
$(".better-select div.form-checkboxes-scroll").each(function(i) {
$this = $(this);
$(this).animate({
scrollTop: $this.find("input:checked").offset().top - $this.offset().top - $this.height() / 2
})
});
Comments
Comment #1
Jonah Ellison commentedOops, change
$(this).animateto$this.animateComment #2
Jonah Ellison commentedJS error fix and remove animate delay:
Comment #3
john franklin commentedI took your jQuery and made it optional. You need to enable 'Scroll to the first selected item' in the Better Select preferences to enable it.
Thanks for the patch.