NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Android
// @namespace http://tampermonkey.net/
// @version 1.3.11
// @description try to take over the world!
// @author You
// @match *developer.android.com/guide/*
// @match *developer.android.com/training/*
// @grant none
// @run-at document-end
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
function a() {
var offSet=[];
$("#nav .selected li a[href*='#']").each(
function(){
offSet.push(
Math.abs(
$($(this).attr("href")+",[name='"+$(this).attr("href").slice(1)+"']").offset().top-
jQuery(window).scrollTop()
)
);
}
);
var min=Math.min(...offSet);
console.log(min);
$("#nav .selected li a[href*='#']").each(
function(){
if(Math.abs($($(this).attr("href")+",[name='"+$(this).attr("href").slice(1)+"']").offset().top-jQuery(window).scrollTop())!==min){
console.log("diferente",this);
$(this).parent().css(
{
'background-color': '',
'color': ''
}
);
}
else{
console.log("igual",this);
$(this).parent().css(
{
'background-color': '#0099cc',
'color': '#fff'
}
);
}
}
);
}
a();
var x=$("#qv>ol,#tb>ol").clone();
$("li.selected").append(x);
$("#qv-wrapper").remove();
$("#jd-content").css({"margin-right":"200px","border-right":"solid 2px #bac2c6","border-left":"solid 2px #bac2c6"});
$(x).find("a").css({color: "#505050"});
$("#body-content").css({"background-color":"gainsboro"});
$("div.jd-descr").css({"padding-left": "5px"});
$(window).scroll(
function() {
a();
}
);
$(window).click(
function() {
a();
}
);
//$(x).click(function(){alert(1);});
//jQuery("#Studio").offset().top-jQuery(window).scrollTop()
//var y=$("body").append("<button>Testsssssss</button>");
//$(y).css({top: "110px", right: "0", position:'fixed',width:'215px'});
})();