Created
November 9, 2016 15:39
-
-
Save 23maverick23/0655f74ef1587ae8f21342b3374e3f50 to your computer and use it in GitHub Desktop.
NS: Transaction item sublist hover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Whitlock Sublist Hover | |
// @version 0.1 | |
// @description Float item sublist header on scroll | |
// @match https://system.netsuite.com/* | |
// @grant none | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var elem = $('#item_layer').append('<div id="floating_header" style="position:fixed;top:60px;display:none;"></div>'); | |
var header = $('#item_splits').closest('tr').find('.uir-machine-headerrow').clone(); | |
var fixed = $('#floating_header').append(header); | |
var tableOffset = $("#item_splits").offset().top; | |
$(window).bind("scroll", function() { | |
var offset = $(this).scrollTop(); | |
if (offset >= tableOffset && fixed.is(":hidden")) { | |
fixed.show(); | |
} | |
else if (offset < tableOffset) { | |
fixed.hide(); | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Ryan for that. I found on Netsuite Hub the version 0.2 also.
Here I would like to freeze the first column when I scroll horizontally. Would you have any idea on how to do it please?