├── CHANGE.md ├── LICENSE.md ├── README.md ├── Scrollup.php ├── ScrollupAsset.php ├── assets ├── CHANGELOG.md ├── README.md ├── css │ └── themes │ │ ├── image.css │ │ ├── link.css │ │ ├── pill.css │ │ ├── tab.css │ │ └── top.png └── js │ ├── jquery.scrollUp.js │ └── jquery.scrollUp.min.js └── composer.json /CHANGE.md: -------------------------------------------------------------------------------- 1 | # version 1.1.0 2 | - update to ScrollUp 2.4.1 (see [CHANGELOG.md](https://github.com/markgoodyear/scrollup/blob/v2.4.1/CHANGELOG.md) for details) 3 | - minor fix 4 | 5 | # version 1.0.0 6 | - Initial release -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Raoul 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | yii2-scrollup-widget 2 | ========================== 3 | Wrapper around "Scroll Up", a "*lightweight jQuery plugin to create a customisable "Scroll to top" feature that will work with any website, with ease*. 4 | 5 | Check out the [ScrollUp Demo page](http://markgoodyear.com/labs/scrollup/) for demo of the Plugin and don't forget to have a look 6 | to the [scrollUp jQuery plugin Home page](http://markgoodyear.com/2013/01/scrollup-jquery-plugin/). 7 | 8 | 9 | Installation 10 | ------------ 11 | 12 | The preferred way to install this extension is through [composer](http://getcomposer.org/download/). 13 | 14 | Either run 15 | 16 | ``` 17 | php composer.phar require --prefer-dist raoul2000/yii2-scrollup-widget "*" 18 | ``` 19 | 20 | or add 21 | 22 | ``` 23 | "raoul2000/yii2-scrollup-widget": "*" 24 | ``` 25 | 26 | to the require section of your `composer.json` file. 27 | 28 | 29 | Usage 30 | ----- 31 | 32 | Once the extension is installed, simply use it in your code by : 33 | 34 | ```php 35 | Scrollup::THEME_IMAGE, 41 | 'pluginOptions' => [ 42 | 'scrollText' => "To top", // Text for element 43 | 'scrollName'=> 'scrollUp', // Element ID 44 | 'topDistance'=> 400, // Distance from top before showing element (px) 45 | 'topSpeed'=> 3000, // Speed back to top (ms) 46 | 'animation' => Scrollup::ANIMATION_SLIDE, // Fade, slide, none 47 | 'animationInSpeed' => 200, // Animation in speed (ms) 48 | 'animationOutSpeed'=> 200, // Animation out speed (ms) 49 | 'activeOverlay' => false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' 50 | ] 51 | ]); 52 | 53 | ?> 54 | ``` 55 | If you wish to use your own styling for the scroll-up, just remove the 'theme' option and provide the required CSS style. 56 | 57 | For more information on the plugin options and usage, please refer to [scrollUp jQuery plugin Home page](http://markgoodyear.com/2013/01/scrollup-jquery-plugin/). 58 | 59 | License 60 | ------- 61 | 62 | **yii2-scrollup-widget** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details. 63 | -------------------------------------------------------------------------------- /Scrollup.php: -------------------------------------------------------------------------------- 1 | theme) && ! in_array($this->theme, $this->_supportedThemes)) { 70 | throw new InvalidConfigException('Unsupported built-in theme : ' . $this->theme); 71 | } 72 | if (isset($this->pluginOptions['animation']) && ! in_array($this->pluginOptions['animation'], $this->_supportedAnimation)) { 73 | throw new InvalidConfigException('Unsupported animation mode : ' . $this->pluginOptions['animation']); 74 | } 75 | } 76 | 77 | /** 78 | * @see \yii\base\Widget::run() 79 | */ 80 | public function run() 81 | { 82 | $this->registerClientScript(); 83 | } 84 | 85 | /** 86 | * Registers the needed JavaScript and inject the JS initialization code. 87 | * 88 | * Note that if a supported theme is set, all css in the assets/css/theme folder are published 89 | * but only the css for the theme is registred.Moreover, if the select theme is 'image', the 90 | * 'scrollText plugin option is cleared. 91 | */ 92 | public function registerClientScript() 93 | { 94 | $view = $this->getView(); 95 | 96 | if (isset($this->theme)) { 97 | $path = $view->getAssetManager()->publish(__DIR__ . '/assets/css/themes'); 98 | $view->registerCSSFile($path[1] . '/' . $this->theme . '.css'); 99 | 100 | if ($this->theme == 'image' && isset($this->pluginOptions['scrollText'])) { 101 | $this->pluginOptions['scrollText'] = ''; 102 | } 103 | } 104 | 105 | ScrollupAsset::register($view); 106 | 107 | $options = empty($this->pluginOptions) ? '{}' : Json::encode($this->pluginOptions); 108 | $js = "$.scrollUp($options);"; 109 | $view->registerJs($js); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /ScrollupAsset.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class ScrollupAsset extends AssetBundle 11 | { 12 | 13 | public $depends = [ 14 | 'yii\web\JqueryAsset' 15 | ]; 16 | 17 | public function init() 18 | { 19 | $this->sourcePath = __DIR__ . '/assets'; 20 | 21 | if (defined('YII_DEBUG')) { 22 | $this->js = [ 23 | 'js/jquery.scrollUp.js' 24 | ]; 25 | } else { 26 | $this->js = [ 27 | 'js/jquery.scrollUp.min.js' 28 | ]; 29 | } 30 | return parent::init(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assets/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.4.1 4 | - Update jQuery dependency 5 | 6 | ## 2.4.0 7 | - Code tidy 8 | - Bug fixes 9 | - Move to gulp 10 | 11 | ## 2.3.3 12 | - Changed `animationInSpeed` & `animationOutSpeed` -> `animationSpeed` 13 | 14 | ## 2.3.2 15 | - Allow to fully disable `scrollTitle` 16 | 17 | ## 2.3.1 18 | - Update jQuery to 1.11.0 19 | - Fix bug with jQuery 1.11.0 20 | - Optimisations 21 | 22 | ## 2.3.0 23 | - Add custom `scrollTarget` option to override where to scroll back to 24 | 25 | ## 2.2.0 26 | - Allow custom `scrollTrigger` element 27 | - Add bower.json 28 | 29 | ## 2.1.1 30 | - Bug fixes 31 | 32 | ## 2.1.0 33 | - Add option to set a custom title to the `` tag 34 | 35 | ## 2.0.0 36 | - Code optimisations 37 | - Destroy method 38 | - Scroll distance from bottom 39 | - Easing implementation (1.3) 40 | - Grunt integration 41 | - Travis CI integration 42 | - Update jQuery to 1.10.2 43 | 44 | ## 1.1.1 45 | - Fix Firefox bug on tab theme in tab.css 46 | 47 | ## 1.1 48 | - Add option for using images (with example) 49 | - Code optimisations 50 | - Update jQuery to 1.9.1 51 | 52 | ## 1.0 53 | - Release 54 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # ScrollUp [](https://travis-ci.org/markgoodyear/scrollup) [](https://david-dm.org/markgoodyear/scrollup#info=devDependencies) 2 | > A jQuery plugin to create a customisable 'Scroll to top' feature that will work with any website 3 | 4 | ## Installing with Bower 5 | 6 | To install scrollUp with Bower: 7 | 8 | ```bash 9 | bower install scrollup 10 | ``` 11 | 12 | ## How to use 13 | 14 | Simply include the `jquery.scrollUp.min.js` file and place the following in the head of your document (make sure **jQuery** is included): 15 | 16 | ### Minimum setup 17 | 18 | ```js 19 | $(function () { 20 | $.scrollUp(); 21 | }); 22 | ``` 23 | 24 | **Example with default options** 25 | 26 | ```js 27 | $(function () { 28 | $.scrollUp({ 29 | scrollName: 'scrollUp', // Element ID 30 | scrollDistance: 300, // Distance from top/bottom before showing element (px) 31 | scrollFrom: 'top', // 'top' or 'bottom' 32 | scrollSpeed: 300, // Speed back to top (ms) 33 | easingType: 'linear', // Scroll to top easing (see http://easings.net/) 34 | animation: 'fade', // Fade, slide, none 35 | animationSpeed: 200, // Animation speed (ms) 36 | scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object 37 | scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number 38 | scrollText: 'Scroll to top', // Text for element, can contain HTML 39 | scrollTitle: false, // Set a custom title if required. 40 | scrollImg: false, // Set true to use image 41 | activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' 42 | zIndex: 2147483647 // Z-Index for the overlay 43 | }); 44 | }); 45 | ``` 46 | 47 | ### activeOverlay 48 | 49 | To create a visible line to help determine an ideal scroll distance from the top, 50 | assign a valid CSS colour to the `activeOverlay` setting. This could be HEX, HSLA or RGB(A). 51 | Example: `activeOverlay: '#00FFFF'`. See the demo for an example. 52 | 53 | 54 | ### scrollFrom 55 | 56 | New feature in v2.0.0. Display the `scrollUp` element either the set distance from the top (default), 57 | or from the bottom of the page. 58 | 59 | ### Destroy method 60 | 61 | New feature in v2.0.0. If you need to destroy the instance of scrollUp, 62 | simple use the following to remove all modifications to the DOM: 63 | 64 | ```js 65 | $.scrollUp.destroy(); 66 | ``` 67 | 68 | 69 | ## Fully Customizable 70 | ScrollUp is fully customisable via CSS which makes it simple to fit right into your project. 71 | Simply target the scrollUp's generated ID in your CSS file and set your styles. 72 | Below is a basic style example: 73 | 74 | ```css 75 | #scrollUp { 76 | bottom: 20px; 77 | right: 20px; 78 | padding: 10px 20px; 79 | background-color: #555; 80 | color: #fff; 81 | } 82 | ``` 83 | 84 | ### Use background image 85 | 86 | To use a background image instead of text, simply set `scrollImg: true`. 87 | This will allow you to set a background image in your CSS file. 88 | 89 | 90 | ## Contributing 91 | 92 | Please see [CONTRIBUTE.md](CONTRIBUTE.md) for info on contributing. 93 | 94 | 95 | ## Demo 96 | 97 | Check out the demo for more style and feature examples. 98 | -------------------------------------------------------------------------------- /assets/css/themes/image.css: -------------------------------------------------------------------------------- 1 | /* Image style */ 2 | #scrollUp { 3 | background-image: url("top.png"); 4 | bottom: 20px; 5 | right: 20px; 6 | width: 38px; /* Width of image */ 7 | height: 38px; /* Height of image */ 8 | } 9 | -------------------------------------------------------------------------------- /assets/css/themes/link.css: -------------------------------------------------------------------------------- 1 | /* Text link style */ 2 | #scrollUp { 3 | bottom: 20px; 4 | right: 20px; 5 | } 6 | -------------------------------------------------------------------------------- /assets/css/themes/pill.css: -------------------------------------------------------------------------------- 1 | /* Pill style */ 2 | #scrollUp { 3 | bottom: 20px; 4 | right: 20px; 5 | background-color: #555; 6 | color: #fff; 7 | font-size: 12px; 8 | font-family: sans-serif; 9 | text-decoration: none; 10 | opacity: .9; 11 | padding: 10px 20px; 12 | -webkit-border-radius: 16px; 13 | -moz-border-radius: 16px; 14 | border-radius: 16px; 15 | -webkit-transition: background 200ms linear; 16 | -moz-transition: background 200ms linear; 17 | -o-transition: background 200ms linear; 18 | transition: background 200ms linear; 19 | -webkit-backface-visibility: hidden; 20 | } 21 | 22 | #scrollUp:hover { 23 | background-color: #000; 24 | } 25 | -------------------------------------------------------------------------------- /assets/css/themes/tab.css: -------------------------------------------------------------------------------- 1 | /* Tab style */ 2 | #scrollUp { 3 | bottom: 0; 4 | right: 30px; 5 | width: 70px; 6 | height: 70px; 7 | margin-bottom: -10px; 8 | padding: 10px 5px; 9 | font: 14px/20px sans-serif; 10 | text-align: center; 11 | text-decoration: none; 12 | text-shadow: 0 1px 0 #fff; 13 | color: #828282; 14 | -webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.2); 15 | -moz-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.2); 16 | box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.2); 17 | background-color: #E6E6E6; 18 | background-image: -moz-linear-gradient(top, #EBEBEB, #DEDEDE); 19 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#EBEBEB), to(#DEDEDE)); 20 | background-image: -webkit-linear-gradient(top, #EBEBEB, #DEDEDE); 21 | background-image: -o-linear-gradient(top, #EBEBEB, #DEDEDE); 22 | background-image: linear-gradient(to bottom, #EBEBEB, #DEDEDE); 23 | background-repeat: repeat-x; 24 | -webkit-transition: margin-bottom 150ms linear; 25 | -moz-transition: margin-bottom 150ms linear; 26 | -o-transition: margin-bottom 150ms linear; 27 | transition: margin-bottom 150ms linear; 28 | } 29 | 30 | #scrollUp:hover { 31 | margin-bottom: 0; 32 | } 33 | -------------------------------------------------------------------------------- /assets/css/themes/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raoul2000/yii2-scrollup-widget/54d0d40755d81b039b90bfb36ed90325294b6864/assets/css/themes/top.png -------------------------------------------------------------------------------- /assets/js/jquery.scrollUp.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * scrollup v2.4.1 3 | * Url: http://markgoodyear.com/labs/scrollup/ 4 | * Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com 5 | * License: MIT 6 | */ 7 | (function ($, window, document) { 8 | 'use strict'; 9 | 10 | // Main function 11 | $.fn.scrollUp = function (options) { 12 | 13 | // Ensure that only one scrollUp exists 14 | if (!$.data(document.body, 'scrollUp')) { 15 | $.data(document.body, 'scrollUp', true); 16 | $.fn.scrollUp.init(options); 17 | } 18 | }; 19 | 20 | // Init 21 | $.fn.scrollUp.init = function (options) { 22 | 23 | // Define vars 24 | var o = $.fn.scrollUp.settings = $.extend({}, $.fn.scrollUp.defaults, options), 25 | triggerVisible = false, 26 | animIn, animOut, animSpeed, scrollDis, scrollEvent, scrollTarget, $self; 27 | 28 | // Create element 29 | if (o.scrollTrigger) { 30 | $self = $(o.scrollTrigger); 31 | } else { 32 | $self = $('', { 33 | id: o.scrollName, 34 | href: '#top' 35 | }); 36 | } 37 | 38 | // Set scrollTitle if there is one 39 | if (o.scrollTitle) { 40 | $self.attr('title', o.scrollTitle); 41 | } 42 | 43 | $self.appendTo('body'); 44 | 45 | // If not using an image display text 46 | if (!(o.scrollImg || o.scrollTrigger)) { 47 | $self.html(o.scrollText); 48 | } 49 | 50 | // Minimum CSS to make the magic happen 51 | $self.css({ 52 | display: 'none', 53 | position: 'fixed', 54 | zIndex: o.zIndex 55 | }); 56 | 57 | // Active point overlay 58 | if (o.activeOverlay) { 59 | $('
', { 60 | id: o.scrollName + '-active' 61 | }).css({ 62 | position: 'absolute', 63 | 'top': o.scrollDistance + 'px', 64 | width: '100%', 65 | borderTop: '1px dotted' + o.activeOverlay, 66 | zIndex: o.zIndex 67 | }).appendTo('body'); 68 | } 69 | 70 | // Switch animation type 71 | switch (o.animation) { 72 | case 'fade': 73 | animIn = 'fadeIn'; 74 | animOut = 'fadeOut'; 75 | animSpeed = o.animationSpeed; 76 | break; 77 | 78 | case 'slide': 79 | animIn = 'slideDown'; 80 | animOut = 'slideUp'; 81 | animSpeed = o.animationSpeed; 82 | break; 83 | 84 | default: 85 | animIn = 'show'; 86 | animOut = 'hide'; 87 | animSpeed = 0; 88 | } 89 | 90 | // If from top or bottom 91 | if (o.scrollFrom === 'top') { 92 | scrollDis = o.scrollDistance; 93 | } else { 94 | scrollDis = $(document).height() - $(window).height() - o.scrollDistance; 95 | } 96 | 97 | // Scroll function 98 | scrollEvent = $(window).scroll(function () { 99 | if ($(window).scrollTop() > scrollDis) { 100 | if (!triggerVisible) { 101 | $self[animIn](animSpeed); 102 | triggerVisible = true; 103 | } 104 | } else { 105 | if (triggerVisible) { 106 | $self[animOut](animSpeed); 107 | triggerVisible = false; 108 | } 109 | } 110 | }); 111 | 112 | if (o.scrollTarget) { 113 | if (typeof o.scrollTarget === 'number') { 114 | scrollTarget = o.scrollTarget; 115 | } else if (typeof o.scrollTarget === 'string') { 116 | scrollTarget = Math.floor($(o.scrollTarget).offset().top); 117 | } 118 | } else { 119 | scrollTarget = 0; 120 | } 121 | 122 | // To the top 123 | $self.click(function (e) { 124 | e.preventDefault(); 125 | 126 | $('html, body').animate({ 127 | scrollTop: scrollTarget 128 | }, o.scrollSpeed, o.easingType); 129 | }); 130 | }; 131 | 132 | // Defaults 133 | $.fn.scrollUp.defaults = { 134 | scrollName: 'scrollUp', // Element ID 135 | scrollDistance: 300, // Distance from top/bottom before showing element (px) 136 | scrollFrom: 'top', // 'top' or 'bottom' 137 | scrollSpeed: 300, // Speed back to top (ms) 138 | easingType: 'linear', // Scroll to top easing (see http://easings.net/) 139 | animation: 'fade', // Fade, slide, none 140 | animationSpeed: 200, // Animation in speed (ms) 141 | scrollTrigger: false, // Set a custom triggering element. Can be an HTML string or jQuery object 142 | scrollTarget: false, // Set a custom target element for scrolling to. Can be element or number 143 | scrollText: 'Scroll to top', // Text for element, can contain HTML 144 | scrollTitle: false, // Set a custom title if required. Defaults to scrollText 145 | scrollImg: false, // Set true to use image 146 | activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' 147 | zIndex: 2147483647 // Z-Index for the overlay 148 | }; 149 | 150 | // Destroy scrollUp plugin and clean all modifications to the DOM 151 | $.fn.scrollUp.destroy = function (scrollEvent) { 152 | $.removeData(document.body, 'scrollUp'); 153 | $('#' + $.fn.scrollUp.settings.scrollName).remove(); 154 | $('#' + $.fn.scrollUp.settings.scrollName + '-active').remove(); 155 | 156 | // If 1.7 or above use the new .off() 157 | if ($.fn.jquery.split('.')[1] >= 7) { 158 | $(window).off('scroll', scrollEvent); 159 | 160 | // Else use the old .unbind() 161 | } else { 162 | $(window).unbind('scroll', scrollEvent); 163 | } 164 | }; 165 | 166 | $.scrollUp = $.fn.scrollUp; 167 | 168 | })(jQuery, window, document); 169 | -------------------------------------------------------------------------------- /assets/js/jquery.scrollUp.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * scrollup v2.4.1 3 | * Url: http://markgoodyear.com/labs/scrollup/ 4 | * Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com 5 | * License: MIT 6 | */ 7 | !function(l,o,e){"use strict";l.fn.scrollUp=function(o){l.data(e.body,"scrollUp")||(l.data(e.body,"scrollUp",!0),l.fn.scrollUp.init(o))},l.fn.scrollUp.init=function(r){var s,t,c,i,n,a,d,p=l.fn.scrollUp.settings=l.extend({},l.fn.scrollUp.defaults,r),f=!1;switch(d=p.scrollTrigger?l(p.scrollTrigger):l("",{id:p.scrollName,href:"#top"}),p.scrollTitle&&d.attr("title",p.scrollTitle),d.appendTo("body"),p.scrollImg||p.scrollTrigger||d.html(p.scrollText),d.css({display:"none",position:"fixed",zIndex:p.zIndex}),p.activeOverlay&&l("",{id:p.scrollName+"-active"}).css({position:"absolute",top:p.scrollDistance+"px",width:"100%",borderTop:"1px dotted"+p.activeOverlay,zIndex:p.zIndex}).appendTo("body"),p.animation){case"fade":s="fadeIn",t="fadeOut",c=p.animationSpeed;break;case"slide":s="slideDown",t="slideUp",c=p.animationSpeed;break;default:s="show",t="hide",c=0}i="top"===p.scrollFrom?p.scrollDistance:l(e).height()-l(o).height()-p.scrollDistance,n=l(o).scroll(function(){l(o).scrollTop()>i?f||(d[s](c),f=!0):f&&(d[t](c),f=!1)}),p.scrollTarget?"number"==typeof p.scrollTarget?a=p.scrollTarget:"string"==typeof p.scrollTarget&&(a=Math.floor(l(p.scrollTarget).offset().top)):a=0,d.click(function(o){o.preventDefault(),l("html, body").animate({scrollTop:a},p.scrollSpeed,p.easingType)})},l.fn.scrollUp.defaults={scrollName:"scrollUp",scrollDistance:300,scrollFrom:"top",scrollSpeed:300,easingType:"linear",animation:"fade",animationSpeed:200,scrollTrigger:!1,scrollTarget:!1,scrollText:"Scroll to top",scrollTitle:!1,scrollImg:!1,activeOverlay:!1,zIndex:2147483647},l.fn.scrollUp.destroy=function(r){l.removeData(e.body,"scrollUp"),l("#"+l.fn.scrollUp.settings.scrollName).remove(),l("#"+l.fn.scrollUp.settings.scrollName+"-active").remove(),l.fn.jquery.split(".")[1]>=7?l(o).off("scroll",r):l(o).unbind("scroll",r)},l.scrollUp=l.fn.scrollUp}(jQuery,window,document); -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "raoul2000/yii2-scrollup-widget", 3 | "description" : "Wrapper around the Scrollup JQuery plugin", 4 | "type" : "yii2-extension", 5 | "keywords" : [ 6 | "yii2", 7 | "extension", 8 | "jquery", 9 | "plugin", 10 | "scroll" 11 | ], 12 | "license" : "BSD-3-Clause", 13 | "authors" : [{ 14 | "name" : "Raoul", 15 | "email" : "raoul.boulard@gmail.com" 16 | } 17 | ], 18 | "require" : { 19 | "yiisoft/yii2" : "*" 20 | }, 21 | "autoload" : { 22 | "psr-4" : { 23 | "raoul2000\\widget\\scrollup\\" : "" 24 | } 25 | }, 26 | "support" : { 27 | "issues" : "https://github.com/raoul2000/yii2-scrollup-widget/issues" 28 | } 29 | } --------------------------------------------------------------------------------