$(window).on("load", function(){ fFixAnchorLinks(); processHeightAdjust('customImageColumnDiv'); }); $(window).on("resize", function(){ processHeightAdjust('customImageColumnDiv'); }); $(document).ready(function(){ $('#lightGallery').lightGallery({ thumbnail : true }); }); //declare the array var processHeightJsNodes = []; function processHeightAdjust(){ //checks that processHeightJsNodes array exists, if not create it var processHeightJsNodes = processHeightJsNodes || []; //looks to see if the values have been cached if not, assigns them if(! processHeightJsNodes[0]){ for (i = 0; i < arguments.length; i++) { //takes the arguments, finds the nodes and pushes them to the procressHeightJSNodes array processHeightJsNodes.push(document.getElementsByClassName(arguments[i])); } } //for each ccs class for (i = 0; i < processHeightJsNodes.length; i++) { var max = 0; var elements = []; //assign the notes to the elents array elements = processHeightJsNodes[i]; //look through them, if the height is more than the max height make it the max height for (x = 0; x < elements.length; x++) { elements[x].removeAttribute("style"); if(elements[x].clientHeight > max) max=Math.ceil(elements[x].clientHeight); } for (y = 0; y < elements.length; y++) { //loop through the elements and apply that max height to them all elements[y].setAttribute("style","height:"+max+"px"); } } } // Fix anchor links not working function fFixAnchorLinks() { var WindowURL = location.href; if(WindowURL.indexOf("#")!==-1) WindowURL = WindowURL.substring(0, WindowURL.indexOf("#")); $("a[href^='#']").each(function(){this.href=WindowURL+$(this).attr("href");}); }