|
|
| (не показано 46 промежуточных версий этого же участника) |
| Строка 1: |
Строка 1: |
| − | /* Добавляет кнопку "Вверх" слева */
| + | mw.loader.using( 'jquery.tipsy', function () { |
| − | | + | $('.tooltip').tipsy({gravity: $.fn.tipsy.autoNS}); |
| − | var snowId = document.getElementById("footer");
| + | } ); |
| − | var solfId = document.createElement("a");
| |
| − | solfId.setAttribute("id","gotop");
| |
| − | solfId.setAttribute("title","Back to top");
| |
| − | snowId.appendChild(solfId);
| |
| − |
| |
| − | function goTop(){ | |
| − | $(window).scroll(function(e) { | |
| − | //If the scroll bar at the top of more than 200 elements
| |
| − | if($(window).scrollTop()>200)
| |
| − | $("#gotop").fadeIn(100);//In a second interval in the id=gotop element
| |
| − | else
| |
| − | $("#gotop").fadeOut(100);//In a second interval fade out the elements of id=gotop
| |
| − | });
| |
| − | };
| |
| − | $(function(){
| |
| − | //Click back on top of the elements
| |
| − | $("#gotop").click(function(e) {
| |
| − | //Return to top with second interval
| |
| − | $('body,html').animate({scrollTop:0},100);
| |
| − | });
| |
| − | $("#gotop").mouseover(function(e) {
| |
| − | $(this).css("background","url(http://localhost/images/backtop.gif) no-repeat 0px -100px");
| |
| − | });
| |
| − | $("#gotop").mouseout(function(e) {
| |
| − | $(this).css("background","url(http://localhost/images/backtop.gif) no-repeat 0px 0px");
| |
| − | });
| |
| − | goTop();//The fade in and fade out back to the top element
| |
| − | }); | |