-
-
Save zdimaz/84a5fa490fa762df950bb0c5649a3b72 to your computer and use it in GitHub Desktop.
table slinky plugin
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
/* basic table sticky*/ | |
.wrapp_table_sticky{ | |
overflow: hidden; | |
} | |
.wrapp_table_sticky .inner_table_sticky{ | |
overflow: auto; | |
padding: 20px 0; | |
margin: -20px 0; | |
} | |
.table_CLASS{ | |
min-width: 960px; | |
} | |
/* basic table sticky*/ | |
/* ========================================================================== | |
Table Slinky plugin | |
========================================================================== */ | |
(function ($){ | |
$.fn.tableSticky = function(options) { | |
var settings = $.extend({ | |
tableStickyItem: ".table-sticky-item", | |
}, options); | |
return this.each(function() { | |
$(settings.tableStickyItem).css({ | |
"position": "relative" | |
}); | |
$(this).on("scroll", function() { | |
$(this).find(settings.tableStickyItem).css({ | |
"left": $(this).scrollLeft() | |
}); | |
}); | |
}); | |
}; | |
}(jQuery)); | |
if ($(".js_table_sticky").length) { | |
$(".js_table_sticky").tableSticky(); | |
}; | |
/* ========================================================================== | |
Table Slinky plugin | |
========================================================================== */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment