在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:flesler/jquery.scrollTo开源软件地址:https://github.com/flesler/jquery.scrollTo开源编程语言:JavaScript 57.9%开源软件介绍:jQuery.scrollToLightweight, cross-browser and highly customizable animated scrolling with jQuery InstallationThe plugin requires jQuery 1.8 or higher. Via bower: bower install jquery.scrollTo Via npm: npm install jquery.scrollto Via packagist: php composer.phar require --prefer-dist flesler/jquery.scrollto "*" Using a public CDNCDN provided by jsdelivr <script src="https://cdn.jsdelivr.net/npm/[email protected]/jquery.scrollTo.min.js"></script> CDN provided by cdnjs <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.3/jquery.scrollTo.min.js"></script> Downloading ManuallyIf you want the latest stable version, get the latest release from the releases page. 2.0Version 2.0 has been recently released. It is mostly backwards compatible, if you have any issue first check this link. If your problem is not solved then go ahead and report the issue. UsagejQuery.scrollTo's signature is designed to resemble $().animate(). $(element).scrollTo(target[,duration][,settings]); elementThis must be a scrollable element, to scroll the whole window use targetThis defines the position to where
settingsThe
You can add any setting supported by $().animate() as well:
window shorthandYou can use Changing the default settingsAs with most plugins, the default settings are exposed so they can be changed. $.extend($.scrollTo.defaults, {
axis: 'y',
duration: 800
}); Stopping the animationjQuery.scrollTo ends up creating ordinary animations which can be stopped by calling $().stop() or $().finish() on the same element you called onAfter and requestAnimationFramejQuery.scrollTo has a $.scrollTo(100, {
onAfter: function() {
requestAnimationFrame(function() {
$(".result").addClass("selected");
});
}
}); DemoCheck the demo to see every option in action. Complementary pluginsThere are two plugins, also created by me that depend on jQuery.scrollTo and aim to simplify certain use cases. jQuery.localScrollThis plugin makes it very easy to implement anchor navigation. If you don't want to include another plugin, you can try using something like this minimalistic gist. jQuery.serialScrollThis plugin simplifies the creation of scrolling slideshows. Troubleshooting
License(The MIT License) Copyright (c) 2007 Ariel Flesler [email protected] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论