Giter Club home page Giter Club logo

ng-scrollable's Introduction

ng-scrollable

Superamazing scrollbars for AngularJS

Why ng-scrollable?

ng-scrollable exists because Firefox does not support scrollbar styling using CSS and other cross-browser alternatives either require jquery (perfect-scrollbar), are not flexible enough or unfriendly to layouts in complex single-page apps.

I hope you can also make use of it in your projects.

Demo: https://echa.github.com/ng-scrollable/

Features

  • It supports mouse, wheel, keyboard and touch input with kinetic scrolling.
  • It's soft scrolling using CSS3 translate3d, transition and requestAnimationFrame.
  • It's responsive, and friendly to your layout.
  • It's fully customizable. CSS, scrollbar position and behavior.
  • It's small. Minified size is 10k JS + 1.4k CSS.
  • It's pure Angular and Javascript. No jquery required.
  • It's MIT licensed.

How to Use

<head>
    <link href="ng-scrollable.min.css" rel="stylesheet">
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
    <script src="ng-scrollable.min.js"></script>
    <script>var app = angular.module('app', ['ngScrollable']);</script>
</head>
<body ng-app="app">
    <div ng-scrollable="{scrollX:'none',scrollY:'left'}" style="width: 100%; height: 300px;">
        <img src="image.png"/>
    </div>
</body>

If the size of your scrollable container or content changes, call

$scope.$emit('content.changed');

from any of your content controllers inside ng-scrollable or

$scope.$broadcast('content.changed');

from outside the ng-scrollable scope.

In case the DOM of your scrollable container changes, call

$scope.$broadcast('content.reload');

from outside the ng-scrollable scope to let ng-scrollable reload DOM node references and reattach event listeners.

Consumed Events

ng-scrollable may be controlled by events sent to the directive's scope, either using $scope.$broadcast from the outside or $scope.$emit from the inside. The scrollable.scroll.* events move the content either to an edge position (such events take no parameter) or to an absolute position.

$scope.$broadcast('scrollable.scroll.left')

Scroll to the left edge of the content. Will change the horizontal position only.

$scope.$broadcast('scrollable.scroll.right')

Scroll to the right edge of the content. Will change the horizontal position only.

$scope.$broadcast('scrollable.scroll.top')

Scroll to the top edge of the content. Will change the vertical position only.

$scope.$broadcast('scrollable.scroll.bottom')

Scroll to the top edge of the content. Will change the vertical position only.

$scope.$broadcast('content.changed', wait, noNotify)

Re-evaluate content and container size and update scrollbars in the next digest cycle or after an optional timeout defined by wait (in ms). If noNotify is True no event is sent when dimensions have changed.

$scope.$broadcast('content.reload', noNotify)

Reloads DOM references and re-registers event handlers before updating dimensions. If noNotify is True no event is sent when dimensions have changed.

$scope.$broadcast('scrollable.scroll.x', left)

Scrolls to the defined horizontal position. If that position is outside the content, the scroll ends at the edge.

$scope.$broadcast('scrollable.scroll.y', top)

Scrolls to the defined vertical position. If that position is outside the content, the scroll ends at the edge.

$scope.$broadcast('scrollable.scroll.xy', left, top)

Scrolls to the defined horizontal and vertical position. If either of the positions is outside the content, the scroll ens at the edge.

Emitted Events

Angular events are notoriously inefficient for high-throughput use cases like scrolling which is the reason why there is no event for every scroll position change. If you need such a feature, use scroll-spies instead.

ng-scrollable sends occasional events when dimensions change or the content approaches one of the edges. You may use the optional parameter events (see below) to control the event propagation direction along the scope stack. Each event also carries an optional id parameter as its last argument which allows you to distinguish multiple ng-scrollable containers. You may define the id using a configuration parameter (see below).

$scope.$on('scrollable.dimensions', function (e, containerWidth, containerHeight, contentWidth, contentHeight, id) {})

Sent on each detected change to the container or content dimensions. The first four parameters are the scrollable dimensions in CSS pixel units. The last parameter is the optional id value.

ng-scrollable sends scroll spy events when the scroll position approaches one of the content's edges. The proximity to an edge may be controlled with the configuration parameter spyMargin, which defines a virtual margin at content edges. Once the virtual margin becomes visible inside the scrollable container, an event is triggered. The margin's size defaults to one page, i.e. one container width or height around the edge. Events are sent only once when entering a margin and again after leaving and re-entering the margin.

Note that with the default setting of one page no event will be sent if the content is smaller than 2x the container size in either dimension. If desired you can set sypMargin to values < 1.

$scope.$on('scrollable.spytop', function (e, contentTop, id) {})

Sent when the top scroll-spy margin becomes visible inside the scrollable container window. This event is not sent again as long as the top margin remains visible. contentTop is the current vertical position of the content inside the scrollable container in CSS pixels.

$scope.$on('scrollable.spybottom', function (e, contentTop, id) {})

Sent when the bottom scroll-spy margin becomes visible inside the scrollable container window. This event is not sent again as long as the bottom margin remains visible. contentTop is the current vertical position of the content inside the scrollable container in CSS pixels, similar to the spyY value.

$scope.$on('scrollable.spyleft', function (e, contentLeft, id) {})

Sent when the left scroll-spy margin becomes visible inside the scrollable container window. This event is not sent again as long as the left margin remains visible. contentLeft is the current horizontal position of the content inside the scrollable container in CSS pixels.

$scope.$on('scrollable.spyright', function (e, contentLeft, id) {})

Sent when the right scroll-spy margin becomes visible inside the scrollable container window. This event is not sent again as long as the right margin remains visible. contentLeft is the current horizontal position of the content inside the scrollable container in CSS pixels, similar to the spyX value.

Optional parameters

ng-scrollable supports optional parameters passed as JS object to the ng-scrollable attribute, e.g.

<div ng-scrollable="{scrollX:'none',scrollY:'left'}"></div>

id

Unique Id value to identify events sent by the scrollable container. Value and type are opaque to ng-scrollable, you may use numbers, strings and even Javascript objects.

scrollX

Position where to display the horizontal scrollbar, either top, bottom or none. Default: bottom

scrollY

Position where to display the vertical scrollbar, either left, right or none. Default: right

minSliderLength

Minimum number of pixels below the slider will not shrink in size. Default: 10

scrollXSlackSpace

Number of pixels the content width may be larger than the container width without making the horizontal scrollbar appear. This allows for some extra room so that a scrollbar is not yet visible just because of a few pixels. Default: 0

scrollYSlackSpace

Number of pixels the content height may be larger than the container height without making the vertical scrollbar appear. This allows for some extra room so that a scrollbar is not yet visible just because of a few pixels. Default: 0

wheelSpeed

Scroll speed applied to wheel event. Default: 1

useBothWheelAxes

When set to true, and only one (vertical or horizontal) scrollbar is active then both vertical and horizontal scrolling events will affect the active scrollbar. Default: false

useKeyboard

When set to true, keyboard events are used for scrolling when the mouse cursor hovers above the content. Small steps (30px) are triggered by up, down, left, right keys. Large steps (1x container width or height) are triggered by PageUp, PageDown, Home and End keys. If horizontal scrolling is inactive (either because scrollX=='none' or contentWidth < containerWidth) Home and End keys jump to top or bottom in vertical direction. Default: true

preventKeyEvents

When set to true (default), keyboard events for all keys supported by ng-scrollable (SPACE, LEFT-ARROW, RIGHT-ARROW, UP-ARROW, DOWN-ARROW, PAGE-UP, PAGE-DOWN, HOME, END) are prevented from triggering their default action (e.g. like scrolling the entire document). To disable this feature in your app, pass preventKeyEvents=false as argument. Default: true

preventWheelEvents

When set to true, wheel events will never be forwarded to the parent DOM container (e.g. the document body). This prevents native body scroll when the content reaches the edge of the ng-scrollable container. If you set this value to false (default) you get the native browser behavior for overflow:scroll elements, i.e. the document body continues scrolling once the content reaches an edge. Default: false

useObserver

When set to true ngScrollable will observe DOM changes inside the scrollable content such as the addition or removal of DOM nodes and automatically trigger a refresh. Note that you still need to manually refresh after layout changes by sending a content.changed event. That is when adding or removing CSS classes or styles that influence the size of the scrollable container or any of its content. Default: true

updateOnResize

When set to true any window.resize event will trigger a full refresh of the scrollable. Default: true

scrollXAlways

Always show the horizontal scrollbar even if the content is smaller than the container. Default: false

scrollYAlways

Always show the vertical scrollbar even if the content is smaller than the container. Default: false

usePadding

Changes the way ng-scrollable determines content dimensions. When True, ng-scrollable uses clientWidth/Height instead of offsetWidth/Height. Default: false

spyMargin

Unitless factor that lets you define the size of the scroll-spy margin relative to the scrollable container's width and height. The margin (virtually) overlaps the content on all edges and triggers an event (see above) when it becomes visible. A value of 0 disables this feature. Default: 1.0

events

Controls how Angular events are sent by ng-scrollable. Supported values are broadcast, emit, both and rootScope. broadcast sends events to child-scopes inside the scrollable container while emit sends them upwards the scope stack to parent containers. both will send events in both ways, first broadcasting, then emitting each event. rootScope emits events on the $rootScope which is the most efficient way of propagating events in Angular, since they do not traverse the scope tree. Setting the parameter to anything else effectively disables events. Default: broadcast

Optional attributes

ng-scrollable supports optional attributes to set or spy on the current scroll position programmatically. Spies may be bound to any Angular expression such as a scope function or scope variable. If the expression evaluates to a settable entity (i.e. a variable), ng-scrollable will set it to the current scroll position in pixels.

spyX

Spy on and control the horizontal scrollbar position.

spyY

Spy on and control the vertical scrollbar position.

A note on performance: Using a settable spy property such as a scope or controller variable (e.g. scope.pos and <div ng-scrollable spy-y="pos"></div>) has a huge performance impact on your application because ng-scrollable runs an Angular digest cycle on each update. Although the digest visits child scopes inside the scrollable container only, it may still affect smooth scrolling, in particular, when you host many or complex directives.

As an alternative, consider using scroll spy events for observing edge proximity and getter functions for passing new position values, e.g.

// JS
var pos = 10;
scope.getPos = function () { return pos; }

// Template
<div ng-scrollable spy-y="getPos()"></div>

Optional CSS classes

ng-scrollable looks for the option CSS class scrollable-ignore when processing wheel events and does not scroll its content when present. You may use this class anywhere inside the scrollable-content container to define nodes that should be excluded from scrolling such as dropdown menus or other overflow: scroll elements.

How does it work?

  • ng-scrollable is pure Javascript and only requires Angular.
  • Content is wrapped with ng-transclude into an overflow:hidden container.
  • Scrollbars are added as sibling element and positioned absolute over the content.
  • Content and scrollbars are soft moving using CSS3 transform3d and transition.
  • Kinetic scrolling using requestAnimationFrame is enabled on touch devices.
  • You can disable X and Y scrolling and choose where scrollbars are displayed.
  • Window resize events are captured to recalculate scrollbar size and position.
  • You can optionally signal content changes by emitting a content.changed event or reload everything with a content.reload event.

Cool, isn't it?

Install

When you already use Bower, the easiest way to get started with ng-scrollable is

bower install ng-scrollable

You can also download the latest stable release from GitHub. If you are brave and can't wait for new releases go ahead and fetch the development version by cloning the Github repository.

git clone https://github.com/echa/ng-scrollable.git
cd ng-scrollable

Developing

You need grunt to lint and minimize sources. Otherwise the project is really simple. I assume you already know what you are doing.

Usage

grunt lint  - check source files
grunt build - build minified version

Limitations

When using ng-scrollable in combination with other Angular directives on the same DOM element, keep in mind that ng-scrollable already injects a HTML template. If other directives have templates as well, they must be linked to separate DOM nodes.

So, for example, if you want to make a ng-view or ui-view scrollable, your HTML should look like

<div ng-scrollable>
	<div ui-view></div>
</div>

Scrollable Container Positioning

The scrollable container must have position relative or absolute for scrollbars to be visible. The CSS class .scrollable already takes care of this, but keep in mind to not interfere when styling the container.

Scrollbar and Content Styling

Scrollbars are placed absolute above the content and inside the scrollable container. Their CSS defines some transparency per default, but they don't push content aside. If you want the bars displayed outside your content you need to specify explicit content margins yourself. To assist you, ng-scrollable inserts the following classes on the content wrapper element when a scrollbar is displayed:

scrollable-top
scrollable-right
scrollable-bottom
scrollable-left

Note that these classes get inserted only when scrolling is not disabled and when the content width or height is larger than the containers width or height.

Scrollable Size Updates

In contrast to browser scrollbars, ng-scrollable does not update automatically with content size. To avoid polling the DOM for changes there is two explicit update mechanism.

  1. ng-scrollable updates on window resize event (enabled by default)
  2. ng-scrollable updates on user event content.changed

You may at any time trigger an update from a controller inside the transcluded content by calling

$scope.$emit('content.changed');

Compatibility

ng-scrollable was tested to work with Angular 1.2.18 up to 1.4.3. However it should be backwards compatible down to Angular 1.1 since it does not use any special features introduced in later versions.

This project only considers supporting recent browser versions to keep the source small and usable (hence, no IE 6/7/8 or other broken browser implementations). Since ng-scrollable doesn't use touch events yet, gestures on mobiles don't work.

I have verified this plugin works with the following Desktop browsers

  • Firefox 30 .. 53
  • Chrome 35 .. 55 and
  • Safari 6.1.4 .. 9.1.3 (OSX)

It may or may not work with other browsers. Let me know your experiences and send pull requests!

When you need support for older browsers, please fork the project and make your own changes.

Contribution

I really welcome contributions! Please feel free to fork and send pull requests when...

  • You have an idea about how to improve ng-scrollable!
  • You have found or fixed a bug!

I'll test and integrate them when time permits.

Help

If you have any idea to improve this project or any problem using it, please create an issue.

License

(c) 2014-2017 Alexander Eichhorn and contributors. Licensed under MIT license.

ng-scrollable's People

Contributors

abodelot avatar anothersymbiote avatar echa avatar mjheller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-scrollable's Issues

Problen when working on devices with mouse and touch screen

  • The directive don't registers handlers for mouse events on touch screen devices, only for touch events, neither for wheel, mouseenter, mouseleave and keydown events. Therefore you can't use mouse wheel (or touchpad on labtops) to scroll when using touch screens.
  • When the ng-scrollable component contains clickable components they will work clicking with mouse on it but not touchin because the touchstart event is prevented.

I have been trying to solve this isues, and it seems to work properly. Firstly I changed 'registerHandlers'/'unregisterHandlers' functions to always register/unregister handlers for wheel, mouseenter, mouseleave and keydown events. Then I changed 'onMouseDownX'/'onMouseDownY' functions to dont' prevent touchstart events.

Thanks!!

not getting scrollbar if I have ng-show

Hi,
I am not getting scrollbar if I have ng-show in my ul element. If i remove this its fine. Can you please help me as I m stucked here. Here is my ul element

    Option 'useKeyboard: false' doesn't work

    It seems the 'useKeyboard' option cannot be deactivated. I'm using the following:

    <div ng-scrollable="{useKeyboard: false}">

    I looked up in the js source and I think this option is never handled, I cannot find any reference to 'config.useKeyboard'.

    Regards,

    -- Alexandre

    Do not scroll if event target of spacebar key is a checkbox

    When scrollable viewport contains checkboxes and I focus them with tab an press a spacebar, I expect the current checbox to change state without viewport being scrolled down.

    Spacebar processing should be improved to support such scenario. Maybe there are also some other cases when we cannot scroll the viewport and kill the event but have to do some checking.

    Vertical scroll doesn't work

    Hi, thanks for this good component.
    I'm using the orizontal scroll in a ng-table like this:

    <div ng-scrollable="{scrollX:'none',scrollY:'left'}" style="width: 300px;">
        <table" ng-table="model.tableParams" class="table table-condensed table-hover" >
            <tr ng-repeat="row in $data" >
                 <td data-title="'...'">
                    {{data}}
                </td><td data-title="'...'">
                    {{data}}
                </td><td data-title="'...'">
                    {{data}}
                </td><td data-title="'...'">
                    {{data}}
                </td><td data-title="'...'">
                    {{data}}
                </td>
            </tr>
        </table>
    </div>
    

    I have a lot of column and a maximum size of 300px so i want a orizontal scroll but I want use the browser's default vertical scroll.
    The orizontal work good but the vertical not. If the mouse is over the div with the ng-scrollable the scroll doesn't move.
    Can anyone help me?
    Thanks in advance

    Problem to installing master branch

    I can't install master branch with bower and show this error:

    bower install ng-scrollable
    bower not-cached    git://github.com/echa/ng-scrollable.git#*
    bower resolve       git://github.com/echa/ng-scrollable.git#*
    bower ENORESTARGET  Tag/branch master does not exist
    
    Additional error details:
    No tags found in git://github.com/echa/ng-scrollable.git
    No branches found in git://github.com/echa/ng-scrollable.git
    

    What can I do to install this directive without problems?

    Scroll event broadcast feature suggestion

    I'd like to use the same transform with transition on some element, so I could move it synchronously with the scrollable element. Could you please add a scroll event broadcast, with scroll coordinates and maybe styles, so I could apply transform and transition to another element?

    style transform not getting added

    i am able to include ng-scrollable in my code and i see that a child div gets created and class="scrollable active" is getting changed when i am scrolling. but the div scrollable content does not include transform: translate3d when i scroll. thus my content is not getting scrolled.

    Feature suggestion - mousweheel speed normalization across browsers

    I noticed that on Mozilla Firefox scrolling is much slower than on Chrome and IE browsers (about 6 times in some larger lists). It's not a problem with ng-scrollbar, but with scrolling in Firefox in general.

    It would be great to have optional ability to normalize scroll speed. Maybe the following StackOverflow topic will give some ideas:
    http://stackoverflow.com/questions/5527601/normalizing-mousewheel-speed-across-browsers

    It is tricky and I'm not asking to implement full support, but at least it might be great to smooth out some huge differences across some browsers.

    Ideally, there should be some way to switch on/off the normalization globally for the entire application through some Angular ConfigurationProvider (you could also add other global settings there, e.g. global wheelSpeed, SlackSpace etc.).

    Scrolling is not enabled/activated until window is resized.

    For whatever reason scrolling does not activate/enable and no scrollbars show until the browser is resized. This seems to kick off some code and then everything works fine.

    The resize can be 1 pixel and the content is already flowing off the page. So it is not like the resize causes the overflow to engage.

    Independent scroll

    Is there a way to have the scrollable div independent by the body window?

    I mean exactly like the demo in https://noraesae.github.io/perfect-scrollbar/

    So if you are with the mouse inside the scrollable div and you scroll reaching the end of it you don't continue to scroll the body until you leave the div with them mouse.

    It disabled window scroll feature

    When try to scroll window after placed mouse pointer at ng-scrollable area, window scroll not working event there is nothing to scroll in my ng-scrollable area. It should scroll window in case of there are nothing to scroll or scrollbar reaches to end. Thanks in advance

    Scrollbars do not appear if container has CSS max-height instead of height

    Could you please take a look at this plunkr:

    http://plnkr.co/edit/hKrKxu2dKQNLDcNCpKvR?p=preview

    Currently it does not show vertical scrollbar.

    Only if I change style.css to have height: 500px instead of current max-height then scrollbar starts working. But I need max-height in my specific case (think about dropdown list which should automatically collapse its height if there are just a few items).

    If I inspect elements, I see that when using max-height, <div class="scrollable"> for some reason takes dimensions of the content and not of the container, therefore ng-scrollable height calculation thinks that there is already enough space and no scrollbars are required.

    I think <div class="scrollable"> should be fixed to always have the actual size of the container.

    The article which might explain why 100% height does not work inside of min- and max- height:
    http://www.456bereastreet.com/archive/201306/height_in_percent_when_parent_has_min-height_and_no_height/

    From my first experiments, it seems that
    .scrollable {
    max-height: inherit;
    }
    works fine in Chrome, but I did not yet test other browsers.

    If this works, then also min-height, min-width and max-width might be needed to support different scenarios. And maybe even width and height could be set to inherit, but I'm not sure.

    Is there any way to support max-height?

    Consider this more a feature request than a bug :)

    "scrollable-ignore" on focused elements

    Hello!

    Was wondering, could there be a solution of my problem:

    I have a very long list inside a ng-scrollable element, which is shown in uib-popover with it's own scroll (max-height; overflow-hidden).

    When focusing on the most bottom element of that list, ng-scrollable launches it's own "handleFocus" function, which leads to content of ng-scrollable scroll to bottom as it sums up all focused element's parent's offsets here:

    while (t && !t.classList.contains('scrollable')) {
                top += t.offsetTop;
                left += t.offsetLeft;
                t = t.offsetParent;
              } 
    

    Current workaround i use, is just adding "scrollable" class to a focusable element.

    Cheers.

    Control the X,Y position dynamically

    Hello,

    I was playing with your directive just now and I was wondering how I can control the X,Y position of the container from outside of the directive. To my surprise that is not possible with the current directive, or did I miss something?

    It would be a great addition since this would allow for more control. I'm trying to create a scroll-able thumbnail list, and your directive suits my purposes quite well if this feature would be available.

    Thanks in advance,
    Harm

    In some specific cases ng-scrollable gets stuck when page loads

    I just found another weird case when for some reason mouse wheel on ng-scrollable does not work right after page loads, if spy-y is enabled:
    http://plnkr.co/edit/xF30Qp3q3c1DqEVitBcb

    This is really strange. For some reason it works just fine if I use ng-repeat instead of some static text. And it suddenly starts working again if I drag the scrollbar down manually (sometimes it does not react immediately, you have to try a few times) or if I change spy-y variable programmatically.

    Support for fixed thead

    When I scroll down, the table header scrolls out of view. I'm trying to find if there is a way to get ngscrollable to keep the thead fixed in place?

    touch support

    Hey mate,
    can you please add touch support for both directions? I also tried to use translate3d instead of translate and it was much more smooth when there are more Elements in the container.

    I created a fork with basic touch support but its only for a specific use case maybe you can use it for reference :)

    Scroll To

    Hi,

    Firstly, I really like your plugin! :)

    I'm using ng-scrollable to display a youtube playlist (through YT data API). I would like to scroll to the currently playing video inside the playlist. I have added an 'active' class to the current video, but can't scroll to it. I created a hack, so when the user hits next for example:
    $rootScope.$broadcast('change-scroll-pos', $scope.selectedIndex * angular.element('.mainScroll .activ').outerHeight() );

    and then inside the scroller controller:

    $scope.$on('change-scroll-pos', function(event, position) { setTimeout(function () { $scope.$broadcast('scrollable.scroll.y', position); }, 300) });

    Sadly the calculation is not perfect, because the outerHeight() gives back an integer, and the actual height is 0.3px bigger than it gives back. Any ideas on how I should approach this?

    Thanks a bunch!

    Wheel behaviour with SVG's

    When the container contains SVG's and the mouse pointer is over them, the wheel behaviour is broken.

    Raised a PR to sanity check the object type.

    Stop scroll propagation to parent

    is there anyway to prevent the scrolling of the parent element when the scrolls begin, or when the scroll bar arrives at the bottom ?

    Sliders stick to mouse when using the directive anywhere on the page

    We just ran into the following issue:
    If you have a slider - <input type='range'> - anywhere on your page you can click it once and then the thumb will stick with your mouse.

    Plunker: http://plnkr.co/edit/sWJmTWImtunqLj819XFQ?p=preview
    Try to move the slider at the top of the page.
    If you remove the div with ng-scrollable the slider is working again.
    It doesn´t matter if the slider is inside an element with ng-scrollable or not.

    scroll conflicted with browser native

    when I used ng-scrollable into a popup layer with angular plugins of ng-pageslide. firstly, I found the function of ng-scrollable isn't active, untill i resized the window or the pop element wrapper. secondly, when I scroll element of popup layer, I found if the body's content has scrollbar, both of them will trigger 'scroll' action.

    bower: Package ng-scrollable not found

    bower install ng-scrollable --save-dev gives a bower error:
    bower ENOTFOUND Package ng-scrollable not found

    When I try to manually install the package with a URL, I get the following error:
    Kingsguard:bbvms JVH$ bower install https://github.com/echa/ng-scrollable.git --save-dev
    bower ng-scrollable#* not-cached https://github.com/echa/ng-scrollable.git#*
    bower ng-scrollable#* resolve https://github.com/echa/ng-scrollable.git#*
    bower ng-scrollable#* cached https://github.com/echa/ng-scrollable
    bower ng-scrollable#* validate https://github.com/echa/ng-scrollable#*
    bower ng-scrollable#* checkout 0.1.0
    bower ng-scrollable#* EMALFORMED Failed to read /bower/ng-scrollable-75826-1zMeig/bower.json

    Additional error details:
    Unexpected token ]

    Registering the package with bower does not work either, it does not accept the JSON (though the JSON itself is correct..).

    scrollYAlways not working

    Hi there,

    I am trying to get the Y scrollBar always displayed but either it seems this feature is not working ( it is setting the css display property to "inherit" but I still have to hover the content to see the scrollbar ) either I am not understanding well the point of that option, or I am missing an extra step to make it work.

    The template looks like that, I am not setting weird css classes ( display and opacity ) on the dom container neither on its parents :

    Best,

    Matthieu

    Feature suggestion - support for automatic or manual fallback to scrollLeft and scrollTop when using forms

    It would be great to be able to tell ng-scrollable to use scrollLeft and scrollTop for cases when I want to put form fields inside it.
    Please take a look at this example:
    http://plnkr.co/edit/z42uJCNlXZErU5idrswj

    Google Chrome browser scrolls automatically when focusing a field which is out of view, thus breaking ng-scrollable. If you have ideas how to fix it transparently for ng-scrollable users, it would be great. But as a workaround it would be just fine to have ability to fall back to scrollLeft and scrollTop (with ng-scrollable synchronizing its scrollbar positions to actual scrollLeft and scrollTop values, when they get changed by the browser) instead of CSS transforms when using forms.

    Cant give a Spacebar in a textbox

    my code is below ===:

    my problem is:
    I cant give a space in that text box. like "firstname lastname". If I put the text box outside "ng-scrollable", then i can do it. In other areas the "ng-scrollable" is working superbly.

    Thanks in advance.

    Firefox transform

    When do you have a flash object inside the div you're trying to use scrollable, the object disappears, it's caused by the CSS property used to scroll : transform: translate(X, Y);

    This bug was noticed using Firefox 36.0.4

    Horizontal scroll blocking natural body scroll

    Check out this homepage http://solascriptura.ro/
    When hovering over the scroll-container the page scrolls just horizontally
    Maybe this behavior is the desired one, but I've found this commit
    7c3cfa4
    where on line 601 the if block is commented. If I uncomment that block I do get the natural vertical page scroll.
    (maybe by the time you see this issue the page will be updated and you won't see the issue as a demo)
    Thank you very much for this useful component

    Separate axes for scrollable-ignore

    I'm wondering if there is a way to use "scrollable-ignore" on an element within the ng-scrollable for only one axis. I'm using ng-scrollable for horizontal scrolling only, within that element there are some elements including a table with a vertically scrollable tbody. This tbody now doesn't scroll at all - unless I use "scrollable-ignore". This unfortunately also disables horizontal scrolling of the whole ng-scrollable element within the tbody.

    Do I have to bind another wheel event to the tbody to scroll it manually or is there another way?

    Max width, max height style bug.

    Hi, thank you for this awesome module. I'm using it in my application right now.
    But I think I found a bug. I wonder why you did this. Maybe you did for some reason.
    Anyway, in your refresh function dom.el[0].clientWidth, dom.el[0].clientHeight is not giving me right size when I'm using <any ng-scrollable style="max-height: 400px;">...</any>.
    Because dom.el is .scrollable class and .scrollable class styled width: 100%; height: 100%;.
    It should be always same size with content's size. (never scrollable)
    So I changed dom.el[0].clientHeight to elem[0].clientHeight it works just fine.
    line: 287 and 288 in current commit

    Doesn't display all items

    hey, I'm trying this plugin with AngularJS 1.4.7 or 1.5.0-rc.0 but it seems like it sometimes displays the wrong number of items, some stay out of view, plunker v1.4.7, v1.5.0-rc.0.
    For 100 user I get sometimes 99 [0-98], sometimes 69 [0-68], and sometimes I got the whole 100 [0-99].

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.