Skip to content

Instantly share code, notes, and snippets.

@cyphr
Last active August 29, 2015 14:10
Show Gist options
  • Save cyphr/26595021dcf3527ec710 to your computer and use it in GitHub Desktop.
Save cyphr/26595021dcf3527ec710 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name lang-8 right bar native language
// @namespace lang8
// @include http://lang-8.com/*/journals/*
// @version 1
// @grant none
// ==/UserScript==
jQuery('#refer_body_mo_bottom').css('display', 'block');
jQuery('#refer_btn_bottom').css('display', 'none');
jQuery(window).bind('scroll resize', function() {
if (window.pageYOffset >= jQuery('#correct_comment').offset().top) {
jQuery('#refer_body_mo_bottom').css({
position: 'fixed',
left: jQuery('#right').offset().left+'px',
top: '50px',
'z-index': 50,
width: jQuery('#right').width()+'px',
height: jQuery(window).height()-jQuery('#header').height()-30+'px',
overflow: 'auto',
display: 'block'
});
}
else {
jQuery('#refer_body_mo_bottom').css({position: 'static', display: 'none'});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment