1// This prevents the execution of the code before the document is finished loading. 2jQuery(document).ready(function() { 3 4 // The 'A+' element in the page is associated with the jQuery click() event. 5 jQuery('#increase-font').click(function(event) { 6 7 // This prevents the default action of the click() event from being triggered. 8 event.preventDefault(); 9 // The jQuery each() event interates over each elements belonging to the 'resize' class 10 jQuery('.resize').each(function() { 11 // Call to a custom function to increase the text size 12 changeTextSize(this, change); 13 }); 14 }); 15 16 // The 'A-' element in the page is associated with the jQuery click() event. 17 jQuery('#decrease-font').click(function(event) { 18 19 // This prevents the default action of the click() event from being triggered. 20 event.preventDefault(); 21 // The jQuery each() event interates over each elements belonging to the 'resize' class 22 jQuery('.resize').each(function() { 23 // Call to a custom function to decrease the text size 24 changeTextSize(this, -change); 25 }); 26 }); 27}); 28 29// Three variables have been used to define range of the text size and the increment/decrement value respectively. 30var min = 14, max = 24, change = 3; 31 32// Defines a custom function with two parameters determining the element to be resized and the size 33function changeTextSize(element, value) { 34 var currentSize = parseFloat(jQuery(element).css('font-size')); 35 var newSize = currentSize + value; 36 if (newSize <= max && newSize >= min) { 37 if (newSize == 23){ 38 jQuery(element).css('font-size', 14 + 'px'); 39 } else if (newSize == 24){ 40 jQuery(element).css('font-size', 15 + 'px'); 41 } else { 42 jQuery(element).css('font-size', newSize + 'px'); 43 } 44 } 45}
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.