Skip to content

Commit

Permalink
3.7.2
Browse files Browse the repository at this point in the history
Fixes
- support for Apple magic mouse swipe back/forward aka Enable only
if needed #378
- wrapper don't works on relative selector aka same
classes not working #635
- horizontal scrollbar visibible but no need it
on responsive layout
- tabindex start counter fix
- setAnimationFrame
for IE8
- touch interaction with multiple scrollareas with IE/Edge on
Surface
- mousewheel not working in safari & click event trigger twice
in mobile #669
- false retriggering of scrollend event
- Not scrolling
on lastest Firefox with HTML5 inside iframe #322

New options
-
scrollbarid, you can set id assigned to scrollbar (default: false =
auto-assigned)

Changes
- some code optimizations inspired from #604 by
dmadan86 (thank you so much!)
- better content area size detection
-
remove support for Windows Phone 7 and 7.1 (mango)
- minimal support
change to IE8

New script iframe helper
Needed to fix, in some
situation, browsers bad implementation of iframe events. (#322)
  • Loading branch information
inuyaksa committed Jun 18, 2017
1 parent 7d44be2 commit d12bff1
Show file tree
Hide file tree
Showing 15 changed files with 2,382 additions and 2,433 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# jQuery.NiceScroll
v. 3.7.0 2017-05-21
v. 3.7.2 2017-06-18

- [Web Site: nicescroll.areaaperta.com](http://nicescroll.areaaperta.com)
- [Web Site: nicescroll.areaaperta.com](https://nicescroll.areaaperta.com)
- [Repo: github.com/inuyaksa/jquery.nicescroll](https://github.com/inuyaksa/jquery.nicescroll)
- [Twitter: @nicescroll](https://twitter.com/nicescroll)

Expand All @@ -14,8 +14,8 @@ v. 3.7.0 2017-05-21
- HORIZONAL scrollbar support!
- It supports DIVs, IFrames, textarea, and document page (body) scrollbars.
- Compatible with all recent desktop browser and older: Firefox 4+, Chrome 5+, Safari 4+ (win/mac), Opera 10+, IE 6+. (all A-grade browsers)
- Compatible with mobile device: iPad/iPhone/iPod, Android 2.2+, Blackberry phones and Playbook (WebWorks/Table OS), Windows Phone 10 and older.
- Compatible with all recent desktop browser and older: Chrome, Firefox, Edge, IE8+, Safari (win/mac), Opera. (all A-grade browsers)
- Compatible with mobile device: iPad/iPhone/iPod, Android 4+, Blackberry phones and Playbook (WebWorks/Table OS), Windows Phone 8 and 10.
- Compatible with all touch devices: iPad, Android tablets, Window Surface.
- Compabible with multi-input device (mouse with touch or pen): Window Surface, Chrome Desktop on touch notebook.
- Compatible with 2 directions mice: Apple Magic Mouse, Apple Mouser with 2-dir wheel, PC mouse with 2-dir wheel (if browser support it).
Expand All @@ -32,15 +32,14 @@ Using animationFrame for a smoothest and cpu-saving scrolling. (when browser sup
"Use strict" tested script for maximum code quality.
Bower and AMD ready.

Warning for IE6 users (why do you uses IE6 yet? Please updgrade to a more stable and modern browser), some feature can't work for limitation of the browser.
Document (body) scrollbars can't appears, old (native browser) one is used. Some issues with IFrame scrolling.
Warning for IE6/7 users (why do you uses yet? Please updgrade to a more stable and modern browser), support for your browser has deprecated.


## FEATURES

- simple installation and activation, it works with NO modification of your code. (some exceptions can happen, so you can write to me)
- very stylish scrollbars, with no occupation on your window (original browser scrollbars need some of page space and reduces window/div usable width)
- you can style main document scrollbar (body) too!! (not all script implements this feature)
- you can style main document scrollbar (body) too!! (not all device/browser support this feature)
- on all browsers you can scroll: dragging the cursor, mouse wheel (speed customizable), keyboard navigation (cursor keys, pagup/down keys, home/end keys)
- scroll is smooth (as modern tablet browsing), speed is customizable
- zoom feature
Expand All @@ -49,25 +48,25 @@ Document (body) scrollbars can't appears, old (native browser) one is used. Some
- dragging scroll mode with scrolling momentum (as touch device)
- tested for all major browsers desktop and mobile versions
- support for touch devices
- support for multi-input devices (IE10 with MSPointer)
- compatible with many other browsers, including IE6, Safari on Mac and WP7 Mango!
- very customizable aspect of bar
- support for multi-input devices (MSPointer/Pointer support)
- compatible with many other browsers and webkit derivated!
- scrollbar has a lot a customizable features
- native scroll events are working yet
- fully integrated with jQuery
- compatibile with jQuery UI, jQuery Touch, jQuery Mobile


## DEPENDENCIES
>> It's a plugin for the jquery framework, you need to include jquery in your scripts.
>> From 1.5.x version and on. (I'd better to use 1.8.3+ minimum)
>> it works with jQuery 1.x / 2.x / 3.x branch (slim version don't works)

* INSTALLATION
Put loading script tag after jquery script tag and loading the zoom image in the same folder of the script:

<script src="jquery.nicescroll.js"></script>

Copy image "zoomico.png" in the same folder of jquery.nicescroll.js.
When you use zoom feature, copy image "zoomico.png" in the same folder of jquery.nicescroll.js.


* HOW TO USE
Expand Down Expand Up @@ -120,7 +119,7 @@ $("#thisdiv").niceScroll({
cursorwidth: "5px", // cursor width in pixel (you can also write "5px")
cursorborder: "1px solid #fff", // css definition for cursor border
cursorborderradius: "5px", // border radius in pixel for cursor
zindex: "auto" | <number>, // change z-index for scrollbar div
zindex: "auto" | [number], // change z-index for scrollbar div
scrollspeed: 60, // scrolling speed
mousescrollstep: 40, // scrolling speed with mouse wheel (pixel)
touchbehavior: false, // DEPRECATED!! use "touchemulate"
Expand Down Expand Up @@ -166,7 +165,9 @@ $("#thisdiv").niceScroll({
oneaxismousemode: "auto", // it permits horizontal scrolling with mousewheel on horizontal only content, if false (vertical-only) mousewheel don't scroll horizontally, if value is auto detects two-axis mouse
scriptpath: "" // define custom path for boxmode icons ("" => same script path)
preventmultitouchscrolling: true // prevent scrolling on multitouch events
disablemutationobserver: false // force MutationObserver disabled
disablemutationobserver: false // force MutationObserver disabled,
enableobserver: true // enable DOM changing observer, it tries to resize/hide/show when parent or content div had changed
scrollbarid: false // set a custom ID for nicescroll bars
});
```

Expand Down
40 changes: 0 additions & 40 deletions changelog_3.7.0.txt

This file was deleted.

28 changes: 28 additions & 0 deletions changelog_3.7.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Changelog nicescroll release 3.7.2
https://nicescroll.areaaperta.com/
https://github.com/inuyaksa/jquery.nicescroll



Fixes
- support for Apple magic mouse swipe back/forward aka Enable only if needed #378
- wrapper don't works on relative selector aka same classes not working #635
- horizontal scrollbar visibible but no need it on responsive layout
- tabindex start counter fix
- setAnimationFrame for IE8
- touch interaction with multiple scrollareas with IE/Edge on Surface
- mousewheel not working in safari & click event trigger twice in mobile #669
- false retriggering of scrollend event
- Not scrolling on lastest Firefox with HTML5 inside iframe #322

New options
- scrollbarid, you can set id assigned to scrollbar (default: false = auto-assigned)

Changes
- some code optimizations inspired from #604 by dmadan86 (thank you so much!)
- better content area size detection
- remove support for Windows Phone 7 and 7.1 (mango)
- minimal support change to IE8

New script iframe helper
Needed to fix, in some situation, browsers bad implementation of iframe events. (#322)
8 changes: 4 additions & 4 deletions demo/browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</style>

<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="js/jquery.nicescroll.min.js"></script>
<script src="js/jquery.nicescroll.js"></script>

<script>
var nice = false;
Expand Down Expand Up @@ -98,7 +98,7 @@
toCell(1,14,!nice.detected.cantouch);
toCell(2,14,!nice.detected.cantouch);
toCell(3,14,nice.detected.cantouch||nice.istouchcapable||nice.hasmstouch||nice.detected.hasw3ctouch);
toCell(4,14,nice.detected.isie9mobile);
//toCell(4,14,nice.detected.isie9mobile);

});

Expand Down Expand Up @@ -255,7 +255,7 @@
<td>Keyboard</td>
<td>Mouse</td>
<td>Touch/Pen</td>
<td>WP7.1(8)</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
Expand All @@ -270,7 +270,7 @@
(5) more smooth native scroll and cpu saving<br />
(6) some problem with zoom feature for browser limitation<br />
(7) use native scrollbar for page<br />
(8) simulated touch support for WP7.1 Mango</p>
</p>
<p>&nbsp; </p>

<script type="text/javascript">
Expand Down
2 changes: 0 additions & 2 deletions demo/js/jquery.nicescroll.min.js

This file was deleted.

Binary file modified demo/js/zoomico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions dist/jquery.nicescroll.iframehelper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/* iframe script helper for jquery.nicescroll
-- version 0.9.0
-- copyright 2017-06-18 InuYaksa*2017
-- licensed under the MIT
--
-- https://nicescroll.areaaperta.com/
-- https://github.com/inuyaksa/jquery.nicescroll
--
*/

(function (document,window) {

var body = document.body;
var parent = window.parent;

if (parent && ("createEvent" in document)) {

var isoldie = ("documentMode" in document); // 11-
var ismsedge = ("msCredentials" in window); // MS Edge 14+

function onwheel(e) {

var evt = document.createEvent("MouseEvents");
evt.initEvent('wheel', true, true);
evt.deltaMode = e.deltaMode;
evt.deltaX = e.deltaX;
evt.deltaY = e.deltaY;
evt.deltaZ = e.deltaZ;
evt.wheelDelta = e.wheelDelta;
evt.wheelDeltaX = e.wheelDeltaX;
evt.wheelDeltaY = e.wheelDeltaY;

parent.dispatchEvent(evt);
}

body.addEventListener("wheel", onwheel);

}

if (window.addEventListener) {

// https://davidwalsh.name/add-rules-stylesheets
var sheet = (function () {
var style = document.createElement("style");
style.appendChild(document.createTextNode(""));
document.head.appendChild(style);
return style.sheet;
})();

var tmrscroll = false;
var lastiframe = null;
var lastiframeviewport = null;
var lastscroll = [];

window.addEventListener("scroll", function (e) {
if (lastiframeviewport) {
// var df = [ window.scrollX - lastscroll[0], window.scrollY - lastscroll[1] ];
window.scrollTo(lastscroll[0], lastscroll[1]);
// lastiframeviewport.scrollBy(df[0],df[1]);
// console.log(df);
}
});

function findNiceParent(t) {
do {
if ($.data(t, '__nicescroll') !== undefined) return t;
t = t.parentNode || false;
} while (t);
return false;
}

window.addEventListener("load", function () {

var hasstyle = false;

$.nicescroll.each(function () {
var nice = this;
nice.scrollstart(function () {
console.log("start");
if (!hasstyle) sheet.insertRule("iframe { pointer-events: none !important; }", 0);
hasstyle = true;
});
nice.scrollend(function () {
console.log("end");
if (hasstyle) sheet.deleteRule(0);
hasstyle = false;
});
});

$("iframe").each(function () {
this.addEventListener("mouseenter", function (e) {
lastiframe = e.target;
var chk = findNiceParent(lastiframe);
lastiframeviewport = chk;
//if (chk) lastiframeviewport = $(chk).getNiceScroll();
lastscroll = [window.scrollX, window.scrollY];
});
this.addEventListener("mouseleave", function (e) {
lastiframe = lastiframeviewport = null;
});
});

});

}

})(document,window);
2 changes: 2 additions & 0 deletions dist/jquery.nicescroll.iframehelper.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d12bff1

Please sign in to comment.