Skip to content

Instantly share code, notes, and snippets.

@23maverick23
Created November 9, 2016 15:39
Show Gist options
  • Save 23maverick23/0655f74ef1587ae8f21342b3374e3f50 to your computer and use it in GitHub Desktop.
Save 23maverick23/0655f74ef1587ae8f21342b3374e3f50 to your computer and use it in GitHub Desktop.
NS: Transaction item sublist hover
// ==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();
}
});
})();
@Nairolf76
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment