1 2var refer = 'https://greinerelectric.com/'; 3var PAGEID = 70849; 4$(function() { 5$(".fancygallery").fancybox(); 6}); 7// GLOBAL JAVASCRIPT 8$(document).ready(function() { 9$('.oms-property-manager-details .row:last-child .col-lg-6:last-child').css('display', 'none'); 10$('.nav-open').click(function() { 11$('.nav-overlay').toggleClass('open'); 12}); 13$('.nav-overlay').click(function(e) { 14if (e.target == this) { 15$('.nav-overlay').removeClass('open'); 16} 17}); 18$('.wrap').click(function(e) { 19if (e.target == this) { 20$('.nav-overlay').toggleClass('open'); 21} 22}); 23}); 24// Call & init 25$(document).ready(function() { 26$('.ba-slider').each(function() { 27var cur = $(this); 28// Adjust the slider 29var width = cur.width() + 'px'; 30cur.find('.resize img').css('width', width); 31// Bind dragging events 32drags(cur.find('.handle'), cur.find('.resize'), cur); 33}); 34}); 35// Update sliders on resize. 36// Because we all do this: i.imgur.com/YkbaV.gif 37$(window).resize(function() { 38$('.ba-slider').each(function() { 39var cur = $(this); 40var width = cur.width() + 'px'; 41cur.find('.resize img').css('width', width); 42}); 43}); 44function drags(dragElement, resizeElement, container) { 45// Initialize the dragging event on mousedown. 46dragElement.on('mousedown touchstart', function(e) { 47dragElement.addClass('draggable'); 48resizeElement.addClass('resizable'); 49// Check if it's a mouse or touch event and pass along the correct value 50var startX = (e.pageX) ? e.pageX : e.originalEvent.touches[0].pageX; 51// Get the initial position 52var dragWidth = dragElement.outerWidth(), 53posX = dragElement.offset().left + dragWidth - startX, 54containerOffset = container.offset().left, 55containerWidth = container.outerWidth(); 56// Set limits 57minLeft = containerOffset + 10; 58maxLeft = containerOffset + containerWidth - dragWidth - 10; 59// Calculate the dragging distance on mousemove. 60dragElement.parents().on("mousemove touchmove", function(e) { 61// Check if it's a mouse or touch event and pass along the correct value 62var moveX = (e.pageX) ? e.pageX : e.originalEvent.touches[0].pageX; 63leftValue = moveX + posX - dragWidth; 64// Prevent going off limits 65if (leftValue < minLeft) { 66leftValue = minLeft; 67} else if (leftValue > maxLeft) { 68leftValue = maxLeft; 69} 70// Translate the handle's left value to masked divs width. 71widthValue = (leftValue + dragWidth / 2 - containerOffset) * 100 / containerWidth + '%'; 72// Set the new values for the slider and the handle. 73// Bind mouseup events to stop dragging. 74$('.draggable').css('left', widthValue).on('mouseup touchend touchcancel', function() { 75$(this).removeClass('draggable'); 76resizeElement.removeClass('resizable'); 77}); 78$('.resizable').css('width', widthValue); 79}).on('mouseup touchend touchcancel', function() { 80dragElement.removeClass('draggable'); 81resizeElement.removeClass('resizable'); 82}); 83e.preventDefault(); 84}).on('mouseup touchend touchcancel', function(e) { 85dragElement.removeClass('draggable'); 86resizeElement.removeClass('resizable'); 87}); 88}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.