Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name ragl header UX improvement
- // @version 1
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
- // @include http://ragl.org/*
- // ==/UserScript==
- fb = $(".container")[0];
- $("#header_meta").remove();
- $("#header_main").append(fb);
- $("#header_main").css({"position":"relative","padding":"8px"});
- $(fb).css({
- "position": "absolute",
- "top": "21px",
- "right": "3px",
- "width": "30px",
- "height": "30px"
- });
- $("#main").css({"padding-top":"150px"});
- $("#header_main_alternate").css({
- "margin-top":"8px",
- "z-index":"1"
- });
- lg = $(".logo a").clone();
- lg.attr('id','newlogo');
- $("#header_main").append(lg);
- $("#newlogo").css({
- "position":"absolute",
- "top": "2px",
- "left": "45px"
- });
- $("#newlogo").css({
- "height":"60px",
- "width":"180px",
- "z-index":"2",
- "display":"none"
- });
- document.addEventListener("scroll", morphHeader);
- function morphHeader(){
- if(document.scrollingElement.scrollTop>100){
- $(".container.av-logo-container").slideUp(200);
- if($(window).width() > 1360) $("#newlogo").fadeIn();
- }else{
- $(".container.av-logo-container").slideDown(200);
- $("#newlogo").fadeOut();
- }
- }
- window.addEventListener("resize", checkSize);
- function checkSize(){
- if($(window).width() < 1360) $("#newlogo").fadeOut();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement