A lightweight cross browser javascript scrollbar.

Overview

tinyscrollbar Build Status Coverage Status NPM version

** HELP MAINTAINER NEEDED!! **

Environments in which to use tinyscrollbar

  • Browser support differs between the jQuery plugin and the plain Javascript microlib. Specifically, the plain Javascript microlib does not support legacy browsers such as IE6-8. Use the jQuery plugin release if support for those browsers is required.
  • Tinyscrollbar can also be used in Node, browser extensions, and other non-browser environments.

What you need to build your own version of tinyscrollbar

In order to build tinyscrollbar, you need to have Node.js/npm, and git 1.7 or later installed.

How to build your own tinyscrollbar

First, clone a copy of the main tinyscrollbar git repo by running:

git clone git://github.com/wieringen/tinyscrollbar.git

Install the grunt-cli package so that you will have the correct version of grunt available from any project that needs it. This should be done as a global install:

npm install -g grunt-cli

Enter the tinyscrollbar directory and install the Node dependencies, this time without specifying a global install:

cd tinyscrollbar && npm install

Make sure you have grunt installed by testing:

grunt -version

Then, to get a complete, minified (w/ Uglify.js), linted (w/ JSHint) version of tinyscrollbar, type the following:

grunt

The build version of tinyscrollbar will be put in the dist/ subdirectory, along with the minified copy and associated map file.

Questions?

If you have any questions, please feel free to email me.

Comments
  • Problem with drag event on firefox (PC)

    Problem with drag event on firefox (PC)

    Hello I found to use drag scroll bar not working on firefox(29.0). It's depend with "ontouchstart". I fixed as below:

    , hasTouchEvents = (navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i)==null) ? false : ("ontouchstart" in document.documentElement)
    

    Is it correct? Maybe have the better solution, I think. Sorry for my English and thanks for your help.

    opened by opoepev 10
  • Resize/update events, $.on(), wrappers for any block and more

    Resize/update events, $.on(), wrappers for any block and more

    Also added $.fn.tinyscrollbarUpdate() method, for window resize events. Thumb min size (very helpful for long lists). Improved selectors speed and heights calculation.

    Please check it out and if makes sense - standalone version update is required as well.

    opened by dmythro 9
  • Scrolling not contained to element in Firefox 28

    Scrolling not contained to element in Firefox 28

    Firefox 28 on OSX 10.9.2

    I'm experiencing a 'leak' where if I use the trackpad to scroll an element, the page also scrolls at a different rate, creating an odd parallax-type event. When I was testing this did not seem to happen on Firefox on Win7. This happened on my own page and the plugin's demo page. Anyone else seeing this issue?

    Edit: I think I have found the issue. Will file a PR when I have time.

    opened by djfarrelly 6
  • update relative when scrollbar is disabled

    update relative when scrollbar is disabled

    I use update 'relative' to keep the current position of the thumb after dynamically changes of the content.

    When the size of the overview does not exceed the viewport, the scrollbar is disabled automatically (as desired), but...

    • the overview is positioned bottom of the viewport (vertical scrollbar)
    • the overview is positioned right aligned (horizontal scrollbar)

    If I change the window size, the tinyscrollbar keeps this "wrong" position by changing the left/top position although the scrollbar is disabled.

    In my opinion the script should align the overview top/left as soon, as the scrollbar is disabled (on any kind of update method).

    I noticed this after I updated to the current version, so I guess it's a bug.

    opened by hmuenzer 5
  • Selectable scrollbar

    Selectable scrollbar

    Though you've dropped all the spaces from scrollbar code in examples, they're still selectable under some arcane circumstances in Chrome. I think it's a good idea to add user-select property into scrollbar's CSS classes.

    opened by polkovnikov-ph 4
  • Bug in Firefox on Mac OS X

    Bug in Firefox on Mac OS X

    There is a bug with the line 210 at least in Firefox using a trackpad from a Macbook pro:

    wheelSpeedDelta = -(evntObj.deltaY || evntObj.detail || (-1 / 3 * evntObj.wheelDelta)) / 40
    

    When evntObj.deltaY is equals to 0, it goes to evntObj.detail which is also equals to 0, which goes to (-1 / 3 * evntObj.wheelDelta) returning a NaN.

    Also only the deltaY is used even if the axis is set to x.

    Here is a pull request that correct this issue: https://github.com/wieringen/tinyscrollbar/pull/51

    opened by dmongeau 3
  • Option to Disable Perpendicular Scrolling?

    Option to Disable Perpendicular Scrolling?

    I am using tinyscrollbar in a mobile webapp with a horizontal scroll.

    The functionality of being able to wheel down and up to scroll left and right is desirable on desktop but I need to disable this functionality on mobile.

    I don't see an option to do this yet, is there any guidance for what I'd need to do in the plugin's code? This is for the jQuery plugin.

    opened by John3x 3
  • Remove dependency on jQuery browser global.

    Remove dependency on jQuery browser global.

    jQuery ought to be loaded as a dependency in an AMD environment; the jQuery browser global detection should be removed from the factory function.

    https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js

    opened by jeffreylo 3
  • 2 SCROLLBARS ON 1 PAGE - scrollbar nonfunctional on 2nd instance

    2 SCROLLBARS ON 1 PAGE - scrollbar nonfunctional on 2nd instance

    Hello! I LOVE your tinyscrollbar script. Thank you for sharing it!!

    I have a single page that has 2 tinyscrollbars on it. The first one functions perfectly so I duplicated it, added a second style (same) but the 2nd one won't function. I deleted the 1st one and that makes the 2nd one work.

    I'm guess I'm just missing something simple and obvious here. Here's my page - bottom middle area of homepage: http://www.greenturf.org/ CSS: http://www.greenturf.org/tinyscrollbar.css I did put the .js files in a "js" folder but I changed that path in the head code.

    If it helps, Here's my code from the homepage:

    SCROLLBAR #1

            <div class="viewport">
                 <div class="overview"><br /><?php foreach ($news_eventsRecords as $record): ?>
                      <span class="hmFeedTitle"><a href="<?php echo htmlencode($record['_link']) ?>"><?php echo htmlencode($record['title']) ?></a></span><br />
                      <span class="hmFeedTxt"><?php echo $record['homepage_teaser']; ?></span><br /><br />
                      <?php endforeach ?>
                      </div>
            </div>
        </div>      
    

    SCROLLBAR #2

            <div class="viewport">
                 <div class="overview"><br /><?php foreach ($blog_feedRecords as $record): ?>
                      <span class="hmFeedTitle"><a href="<?php echo htmlencode($record['link_to_article_page']) ?>"><?php echo htmlencode($record['title']) ?></a></span><br />
                      <span class="hmFeedTxt"><?php echo $record['homepage_teaser']; ?></span><br /><br />
                      <?php endforeach ?>
                      </div>
            </div>
        </div>              
    

    THANKS SO MUCH! TINA

    opened by ptfagan 3
  • Drag not Working in Firefox 40.0.3 OSX 10.9.5

    Drag not Working in Firefox 40.0.3 OSX 10.9.5

    Scrolling works fine, but you cant use it dragging the thumb on the scroll bar, it just wont move. (Tried on http://baijs.com/tinyscrollbar/) Any fixes for that?

    opened by chriz1984 2
  • Stop wheel event propagation to support nested scrollbars

    Stop wheel event propagation to support nested scrollbars

    Nested scrollbars are currently broken in regard to the wheel event. When you try scrolling the inner scrollbar the outer scrollbar is also scrolled.

    Stopping the wheel event makes this work as expected. I'm not sure if / what drawbacks could this introduce, for my testcase this seems to work just fine.

    opened by andreieftimie 2
  • Problem with positioning to the bottom

    Problem with positioning to the bottom

    Hello

    The problem is the following. Initialize and positioning $(document).ready(). But sometimes, at the time positioning of the content is not drawn until the end. The result is that the actual size is larger than the calculated and part of the text hangs over the bottom border.

    While doing the initialization in $(window).load().

    But maybe there is some solution to the problem?

    opened by alosev 0
  • Browser ctrl+f autoscroll doesn't work

    Browser ctrl+f autoscroll doesn't work

    Demonstration: On this page https://baijs.com/tinyscrollbar/ ctrl+f merychippus will result in 1 of 3 matches, but will not automatically scroll to the location, though the automatic highlighting does work when you manually scroll.

    opened by xytxytxyt 0
  • Issue with update dinamicaly scrooll

    Issue with update dinamicaly scrooll

    Sorry for my bad english :).

    Update to N px issue - content bottom must be at the bottom of viewport.

    How to check this issue. I have in content some blocks (elements). I try to dynamically scroll to this elements. Call method update(element.top), if this is last element there is space above it instead to place this item at the bottom of viewport.

    How to fix:

    //after line 184: check if content bottom is the same as  viewport bottom
        if((this.contentSize - this.contentPosition - 1) < this.viewportSize){
                // set viewport bottom = content bottom
    	this.contentPosition = Math.max(this.contentSize - this.viewportSize, 0);
    }
    
    opened by catiraumihail 0
  • Fixed case in FF when evntObj.deltaY is zero;

    Fixed case in FF when evntObj.deltaY is zero;

    Found an edge-case when after some intensive scrolling in FireFox - evntObj.deltaY at one point is zero. And since evntObj.wheelDelta is undefined, the wheelDelta variable becomes NaN. Which breaks further scrolling (as visible from screenshots below).

    image

    image

    The fix added - falling back on zero, if any of evntObj.deltaY || evntObj.detail || (-1 / 3 * evntObj.wheelDelta) is falsy.

    opened by oxala 1
  • Scrolling problem in FF on OS X

    Scrolling problem in FF on OS X

    In Firefox OS X, scrolling was problematic. I found that scrolling the various panels would become periodically unresponsive. I have 4 panels with the scrollbars. I periodically do update() on one of them. I can't said what exactly causes the problem. Calling update() on the broken one fixes the problem, but it's not a solution. Chrome and Safari didn't have this issue. The problem is in the latest FF on latest OS. On Windows it works fine.

    opened by fremail 2
A lightweight jQuery custom scrollbar plugin, that triggers event when reached the defined point.

Scrollbox A lightweight jQuery custom scrollbar plugin, that triggers event when reached the defined point. Demo Page Table of contents Browser compat

null 15 Jul 22, 2022
jQuery CSS Customizable Scrollbar

jQuery Scrollbar Cross-browser CSS customizable scrollbar with advanced features: Easy to implement No fixed height or width Responsive design support

Yuriy Khabarov 754 Jan 3, 2023
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin

Zebra Datepicker A super-lightweight, highly configurable, cross-browser date/time picker jQuery plugin Zebra_Datepicker is a small yet and highly con

Stefan Gabos 391 Dec 29, 2022
Modern Cross Browser Testing in JavaScript using Playwright

Modern Cross Browser Testing in JavaScript using Playwright This repository contains the example code for the Modern Cross Browser Testing in JavaScri

Applitools 5 Oct 3, 2022
Simple wrapper for cross-browser usage of the JavaScript Fullscreen API

screenfull Simple wrapper for cross-browser usage of the JavaScript Fullscreen API, which lets you bring the page or any element into fullscreen. Smoo

Sindre Sorhus 6.7k Dec 30, 2022
🔨 Cross-browser JavaScript library to disable scrolling page

scroll-lock Cross-browser JavaScript library to disable scrolling page Live demo | README на русском New features 2.0 More advanced touch event handli

null 253 Dec 17, 2022
A lightweight extension to automatically detect and provide verbose warnings for embedded iframe elements in order to protect against Browser-In-The-Browser (BITB) attacks.

Enhanced iFrame Protection - Browser Extension Enhanced iFrame Protection (EIP) is a lightweight extension to automatically detect and provide verbose

odacavo 16 Dec 24, 2022
Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

LironH 4 Jul 15, 2022
dotdotdot.js, advanced cross-browser ellipsis for multiple line content.

dotdotdot Dotdotdot is a javascript plugin for truncating multiple line content on a webpage. It uses an ellipsis to indicate that there is more text

Fred Heusschen 1.7k Dec 20, 2022
🦎 The cross browser extension that blends in

Rango Rango is a cross browser extension that helps you interact with web pages using your voice and talon. It does this by drawing hints with letters

David Tejada 37 Jan 3, 2023
A cross-platform browser extension that changes the way seasons are display on Crunchyroll.

Crunchyroll With Better Seasons Crunchyroll With Better Seasons is a cross-platform browser extension that changes the way seasons are displayed on Cr

null 9 Nov 4, 2022
Pretty, customisable, cross browser replacement scrollbars

jScrollPane - cross browser custom scroll bars jScrollPane is a jQuery plugin which allows you to replace a browser's default scroll bars (on an eleme

Kelvin Luck 2.2k Dec 15, 2022
A jQuery plugin that adds cross-browser mouse wheel support.

jQuery Mouse Wheel Plugin A jQuery plugin that adds cross-browser mouse wheel support with delta normalization. In order to use the plugin, simply bin

jQuery 3.9k Dec 26, 2022
Freewall is a cross-browser and responsive jQuery plugin to help you create grid, image and masonry layouts for desktop, mobile, and tablet...

Freewall Freewall is a cross-browser and responsive jQuery plugin to help you create many types of grid layouts: flexible layouts, images layouts, nes

Minh Nguyen 1.9k Dec 27, 2022
Cross-browser plugin to remove addictive features on YouTube like thumbnails, comments, previews and more...

ZenTube Installation Features Remove some (more) elements from Youtube to make it less addictive. Mix and match between the following options: Hide or

inversepolarity 57 Dec 17, 2022
EggyJS is a Javascript micro Library for simple, lightweight toast popups focused on being dependency-less, lightweight, quick and efficient.

EggyJS EggyJS is a Javascript micro Library for simple, lightweight toast popups. The goal of this library was to create something that meets the foll

Sam 10 Jan 8, 2023
Cross-runtime JavaScript framework

Primate, a cross-runtime framework Primate is a full-stack cross-runtime Javascript framework (Node.js and Deno). It relieves you of dealing with repe

null 8 Nov 7, 2022
Functions for testing the types of JavaScript values, cross-realm. Has testers for all standard built-in objects/values.

@suchipi/is Functions for testing the types of JavaScript values, cross-realm. Has testers for all standard built-in objects/values. Usage import { is

Lily Skye 5 Sep 8, 2022
A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.

JsRender: best-of-breed templating Simple and intuitive, powerful and extensible, lightning fast For templated content in the browser or on Node.js (w

Boris Moore 2.7k Jan 2, 2023