Railgun Wiki
Advertisement
public class A {
    public static void main(String[] args) {
        System.out.println("Hello world");
    }
}
<html><head><script>$(document).ready(function () {
    $('#something').css('color', 'red');
});</script>
</head><body><p id="something">Hello world!</p></body></html>
var $rail = $('#WikiaRail');
$rail.css('position', 'relative');
 
// rail's initial position from top of window
var railTop = $rail.position().top;
 
// rail's height
var height = $rail.height();
 
// footer's initial position from top of window
var footerTop = $('#WikiaFooter').position().top
 
// scroll event handler
$(window).scroll(function () {
    var y = window.scrollY;
    if (y < railTop + 30) {
        // case where scroll position is near global header
        $rail.css('top', 0);
    } else if (y >= footerTop - height) {
        // case where scroll position is near the corporate footer
        $rail.css('top', ((footerTop - height - railTop) + 'px'));
    } else { $rail.css('top', ((y - railTop - 30) + 'px')); // general case: scroll position between top and bottom of webpage
    }
});
Advertisement