custom-javascript.js
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Add your custom JS here.
import jquery from 'jquery';
import LazyLoad from "vanilla-lazyload";
import DataTable from 'datatables.net-dt';
import "./_menu_mobile";
import "./_search";
import "./_header_menu";
import "./_side_menu";
import "./_image_captionation";
import "./_carousels";
var myLazyLoad = new LazyLoad();
window.tz_checkVisible = function(elm, evalType , offset, heightBuffer) {
evalType = evalType || "visible";
var vpH = jQuery(window).height(), // Viewport Height
st = jQuery(window).scrollTop(), // Scroll Top
y = jQuery(elm).offset().top + offset,
elementHeight = jQuery(elm).height();
if (heightBuffer) {
elementHeight += heightBuffer;
}
if (evalType === "visible") return ((y < (vpH + st)) && (y > (st - elementHeight)));
if (evalType === "above") return ((y < (vpH + st)));
};
jQuery(document).ready(function() {
console.log('ready');
jQuery('#relevant-resources').dataTable( {
info: false,
ordering: false,
paging: true,
bLengthChange: false,
bFilter: false,
pagingType: "numbers",
pageLength: 10
} );
} );