Allows for easy implementation of smooth scrolling for same-page links.
今天,闪电吧要来分享的是Mac下一款鼠标增强工具Smoothscroll,或许很多朋友还不熟悉它,没关系,闪电吧就来正式介绍下。 Smoothscroll可以让鼠标的滚动达到Mac下触控板的丝般顺滑,让没有触控板的设备也能享受触控板的功能。这次带来的是最新1.1.5版本,完美兼容macOS. Visual Studio Code Sync Settings GIST. GitHub Gist: instantly share code, notes, and snippets. Django Frontend¶. Django Frontend is a collection of static files and templates to jumpstart Django front-end development. With the convenience of an installable Django application, easily add some of the most widely used static files and create custom templates built on top of one of the most well-known, widespread templates (HTML5 Boilerplate.). . Please note that Apple, Compaq, Cisco, Dell, IBM, HP, Maxtor, Fujitsu, Seagate, Sun or any item that is not a 3D memory product once processed can not be cancelled or returned for credit.
Note: Version 2.0+ of this plugin requires jQuery version 1.7 or greater.
Download
Using npm:
The old-fashioned way:
Go to the following URL in your browser and copy/paste the code into your own file:https://raw.githubusercontent.com/kswedberg/jquery-smooth-scroll/master/jquery.smooth-scroll.js
Demo
You can try a bare-bones demo at kswedberg.github.io/jquery-smooth-scroll/demo/
Features
$.fn.smoothScroll
- Works like this:
$('a').smoothScroll();
- Specify a containing element if you want:
$('#container a').smoothScroll();
- Exclude links if they are within a containing element:
$('#container a').smoothScroll({excludeWithin: ['.container2']});
- Exclude links if they match certain conditions:
$('a').smoothScroll({exclude: ['.rough','#chunky']});
- Adjust where the scrolling stops:
$('.backtotop').smoothScroll({offset: -100});
- Add a callback function that is triggered before the scroll starts:
$('a').smoothScroll({beforeScroll: function() { alert('ready to go!'); }});
- Add a callback function that is triggered after the scroll is complete:
$('a').smoothScroll({afterScroll: function() { alert('we made it!'); }});
- Add back button support by using a
hashchange
event listener. You can also include a history management plugin such as Ben Alman's BBQ for ancient browser support (IE < 8), but you'll need jQuery 1.8 or earlier. See demo/hashchange.html or demo/bbq.html for an example of how to implement.
Options
The following options, shown with their default values, are available for both
$.fn.smoothScroll
and $.smoothScroll
:The options object for
$.fn.smoothScroll
can take two additional properties:exclude
and excludeWithin
. The value for both of these is an array ofselectors, DOM elements or jQuery objects. Default value for both is anempty array.Setting options after initial call
If you need to change any of the options after you've already called
.smoothScroll()
,you can do so by passing the 'options'
string as the first argument and anoptions object as the second.$.smoothScroll
- Utility method works without a selector:
$.smoothScroll()
- Can be used to scroll any element (not just
document.documentElement
/document.body
) - Doesn't automatically fire, so you need to bind it to some other userinteraction. For example:
- The
$.smoothScroll
method can take one or two arguments.- If the first argument is a number or a 'relative string,' the document is scrolled to thatposition. If it's an options object, those options determine how thedocument (or other element) will be scrolled.
- If a number or 'relative string' is provided as the second argument, it will override whatever may have been set for the
scrollTarget
option. - The relative string syntax, introduced in version 2.1, looks like
'+=100px'
or'-=50px'
(see below for an example).
Additional Option
The following option, in addition to those listed for
$.fn.smoothScroll
above, is availablefor $.smoothScroll
:$.fn.scrollable
- Selects the matched element(s) that are scrollable. Acts just like aDOM traversal method such as
.find()
or.next()
. - The resulting jQuery set may consist of zero, one, or multipleelements.
$.fn.firstScrollable
- Selects the first matched element that is scrollable. Acts just like aDOM traversal method such as
.find()
or.next()
. - The resulting jQuery set may consist of zero or one element.
- This method is used internally by the plugin to determine which elementto use for 'document' scrolling:
$('html, body').firstScrollable().animate({scrollTop: someNumber}, someSpeed)
Examples
Scroll down one 'page' at a time (v2.1+)
With smoothScroll version 2.1 and later, you can use the 'relative string' syntax to scroll an element or the document a certain number of pixels relative to its current position. The following code will scroll the document down one page at a time when the user clicks the '.pagedown' button:
Smooth scrolling on page load
If you want to scroll to an element when the page loads, use
$.smoothScroll()
in a script at the end of the body or use $(document).ready()
. To prevent the browser from automatically scrolling to the element on its own, your link on page 1 will need to include a fragment identifier that does not match an element id on page 2. To ensure that users without JavaScript get to the same element, you should modify the link's hash on page 1 with JavaScript. Your script on page 2 will then modify it back to the correct one when you call $.smoothScroll()
.For example, let's say you want to smooth scroll to
<div></div>
on page-2.html. For page-1.html, your script might do the following:Then for page-2.html, your script would do this:
Focus element after scrolling to it.
Imagine you have a link to a form somewhere on the same page. When the user clicks the link, you want the user to be able to begin interacting with that form.
- As of smoothScroll version 2.2, the plugin will automatically focus the element if you set the
autoFocus
option totrue
. - In the future, versions 3.x and later will have
autoFocus
set to true by default. - If you are using the low-level
$.smoothScroll
method,autoFocus
will only work if you've also provided a value for thescrollTarget
option. - Prior to version 2.2, you can use the
afterScroll
callback function. Here is an example that focuses the first input within the form after scrolling to the form:
For accessibility reasons, it might make sense to focus any element you scroll to, even if it's not a natively focusable element. To do so, you could add a
tabIndex
attribute to the target element (this, again, is for versions prior to 2.2):Notes
- To determine where to scroll the page, the
$.fn.smoothScroll
method looksfor an element with an id attribute that matches the<a>
element's hash.It does not look at the element's name attribute. If you want a clicked linkto scroll to a 'named anchor' (e.g.<a name='foo'>
), you'll need to use the$.smoothScroll
method instead. - The plugin's
$.fn.smoothScroll
and$.smoothScroll
methods use the$.fn.firstScrollable
DOM traversal method (also defined by this plugin)to determine which element is scrollable. If no elements are scrollable,these methods return a jQuery object containing an empty array, just likeall of jQuery's other DOM traversal methods. Any further chained methods,therefore, will be called against no elements (which, in most cases,means that nothing will happen).
Smooth Scroll 1 1 60
Contributing
Thank you! Please consider the following when working on this repo before you submit a pull request:
- For code changes, please work on the 'source' file:
src/jquery.smooth-scroll.js
. - Style conventions are noted in the
jshint
grunt file options and the.jscsrc
file. To be sure your additions comply, rungrunt lint
from the command line. - If possible, please use Tim Pope's git commit message style. Multiple commits in a pull request will be squashed into a single commit. I may adjust the message for clarity, style, or grammar. I manually commit all merged PRs using the
--author
flag to ensure that proper authorship (yours) is maintained.
SmoothScroll-1.1.6.torrent
Name: SmoothScroll
Version: 1.1.6
Size: 944.56 KB
Mac Platform: Intel
Includes: K
Version: 1.1.6
Size: 944.56 KB
Mac Platform: Intel
Includes: K
OS version: 10.9 or later
Processor type(s) & speed: 64-bit processor
RAM minimum:
Video RAM:
Processor type(s) & speed: 64-bit processor
RAM minimum:
Video RAM:
Smooth Scroll 1 1 6 X
K applying instruction:
1. Do not open the app after the installation!
2. Copy file “SmoothScroll” from ‘SmoothScroll K.zip” to …/Applications/SmoothScroll/Contents/MacOs/
3. Open the app and register it with any username and key you like.
4. Close the app.
5. In …/Applications/SmoothScroll/Contents edit Info.plist in part:
2. Copy file “SmoothScroll” from ‘SmoothScroll K.zip” to …/Applications/SmoothScroll/Contents/MacOs/
3. Open the app and register it with any username and key you like.
4. Close the app.
5. In …/Applications/SmoothScroll/Contents edit Info.plist in part:
SUAllowsAutomaticUpdates
SUAutomaticallyUpdate
SUEnableAutomaticChecks
Replace the fragment from above with the following:
SUAllowsAutomaticUpdates
SUAutomaticallyUpdate
Smooth Scroll 1 1 6 2
SUEnableAutomaticChecks
Smooth Scroll 1 1 6 Scale
6. Save “Info.plist”
7. Enjoy
7. Enjoy
More Info: http://www.smoothscroll.net/mac/
SmoothScroll
SmoothScroll is finally available as an app to give your Mac (Finder, Safari, Chrome, etc.) buttery smooth scrolling. Give it a spin — trusted by more than 150,000 people.
SmoothScroll is finally available as an app to give your Mac (Finder, Safari, Chrome, etc.) buttery smooth scrolling. Give it a spin — trusted by more than 150,000 people.