1function wds_display_hotspot() { 2 jQuery(".wds_layer").each(function() { 3 if (jQuery(this).data("displaytype") == "hover") { 4 jQuery(this).hover(function() { 5 jQuery(this).next().next().hide(); 6 jQuery(this).next().next().stop().fadeIn(); 7 }, function() { 8 jQuery(this).next().next().stop().fadeOut(); 9 }); 10 } 11 else { 12 jQuery(this).click(function(e) { 13 e.stopPropagation(); 14 if (jQuery(this).next().next().is(":visible") == true) { 15 jQuery(this).next().next().stop().fadeOut(); 16 } 17 else { 18 jQuery(this).next().next().hide(); 19 jQuery(this).next().next().stop().fadeIn(); 20 } 21 }); 22 jQuery("body").click(function() { 23 jQuery('span[data-type="hotspot_text"]').fadeOut(); 24 }); 25 } 26 }); 27} 28 29function wds_hotspot_position(prefix, ratio) { 30 if (typeof prefix == 'undefined' || prefix == "") { 31 var hotspot_layer = ".hotspot_container"; 32 } 33 else { 34 hotspot_layer = "#" + prefix + "_div"; 35 } 36 if (typeof ratio == 'undefined') { 37 var ratio = 1; 38 } 39 var arrow_size = Math.round(7 * ratio); 40 var distance = Math.round(20 * ratio); 41 42 jQuery(hotspot_layer).each(function() { 43 var layer_id = jQuery(this).attr("id").replace("_div", ""); 44 var text_pos = jQuery(this).attr("data-text_position"); 45 var slide_width = jQuery(this).parent().outerWidth(); 46 var slide_height = jQuery(this).parent().outerHeight(); 47 var layer_left = parseFloat(jQuery(this).css("left")); 48 var layer_top = parseFloat(jQuery(this).css("top")); 49 var layer_text_bgcolor = jQuery(this).find("span:nth-child(3)").css("background-color"); 50 51 var chw1, chw2, chw3, chh1, chh2, chh3, marginTop, left, right; 52 var right_border, left_border, top_border, bottom_border, bottom_angle, top_angle; 53 chw1 = parseFloat(jQuery(this).find("span:nth-child(1)").outerWidth()); 54 chw2 = parseFloat(jQuery(this).find("span:nth-child(2)").outerWidth()); 55 chw3 = parseFloat(jQuery(this).find("span:nth-child(3)").outerWidth()); 56 57 chh1 = parseFloat(jQuery(this).find("span:nth-child(1)").outerHeight()); 58 chh2 = parseFloat(jQuery(this).find("span:nth-child(2)").outerHeight()); 59 chh3 = parseFloat(jQuery(this).find("span:nth-child(3)").outerHeight()); 60 61 right_border = layer_left + ((text_pos == "top" || text_pos == "bottom") ? (chw3 / 2 + chw1 / 2) : (chw2 + chw3 + distance)); 62 left_border = layer_left - ((text_pos == "top" || text_pos == "bottom") ? (chw3 / 2 - chw1 / 2) : (chw3 + distance)); 63 64 top_border = (text_pos == "left" || text_pos == "right") ? layer_top : (layer_top - chh3 - distance); 65 bottom_border = (text_pos == "left" || text_pos == "right") ? (layer_top + chh2) : (layer_top + chh2 + chh3 + distance); 66 67 bottom_angle = layer_top + chh2 / 2 + chh3 / 2; 68 top_angle = layer_top - chh3 / 2 + chh2 / 2; 69 70 if (right_border > slide_width) { 71 text_pos = "left"; 72 } 73 else if (left_border < 0) { 74 text_pos = "right"; 75 } 76 else if (top_border < 0) { 77 text_pos = "bottom"; 78 } 79 else if (bottom_border > slide_height) { 80 text_pos = "top"; 81 } 82 83 if (top_angle < 0) { 84 if (text_pos == "right") { 85 text_pos = "top-left"; 86 } 87 else if (text_pos == "left") { 88 text_pos = "top-right"; 89 } 90 } 91 else if (bottom_angle > slide_height) { 92 if (text_pos == "right") { 93 text_pos = "bottom-left"; 94 } 95 else if (text_pos == "left") { 96 text_pos = "bottom-right"; 97 } 98 } 99 100 jQuery(this).find("span.hotspot_text_before").removeAttr("style"); 101 if (text_pos == "bottom-left") { 102 marginTop = "-" + (chh3 - chw2) + "px"; 103 left = (chw2 + distance) + 'px'; 104 right = 'auto'; 105 jQuery(this).find("span.hotspot_text_before").css({ 106 left: "-" + arrow_size + "px", 107 top: (chh3 - (2 * arrow_size + 3)) + "px", 108 borderTop: arrow_size + "px solid transparent", 109 borderBottom: arrow_size + "px solid transparent", 110 borderRight: arrow_size + "px solid " + layer_text_bgcolor 111 }); 112 } 113 else if (text_pos == "bottom-right") { 114 marginTop = "-" + (chh3 - chw2) + "px"; 115 left = 'auto'; 116 right = (chw2 + distance) + 'px'; 117 jQuery(this).find("span.hotspot_text_before").css({ 118 right: "-" + arrow_size + "px", 119 top: (chh3 - (2 * arrow_size + 3)) + "px", 120 borderTop: arrow_size + "px solid transparent", 121 borderBottom: arrow_size + "px solid transparent", 122 borderLeft: arrow_size + "px solid " + layer_text_bgcolor 123 }); 124 } 125 else if (text_pos == "top-left") { 126 marginTop = 0; 127 left = (chw2 + distance) + 'px'; 128 right = 'auto'; 129 jQuery(this).find("span.hotspot_text_before").css({ 130 left: "-" + arrow_size + "px", 131 top: "3px", 132 borderTop: arrow_size + "px solid transparent", 133 borderBottom: arrow_size + "px solid transparent", 134 borderRight: arrow_size + "px solid " + layer_text_bgcolor 135 }); 136 } 137 else if (text_pos == "top-right") { 138 marginTop = 0; 139 left = 'auto'; 140 console.log(chw2); 141 right = (chw2 + distance) + 'px'; 142 jQuery(this).find("span.hotspot_text_before").css({ 143 right: "-" + arrow_size + "px", 144 top: "3px", 145 borderTop: arrow_size + "px solid transparent", 146 borderBottom: arrow_size + "px solid transparent", 147 borderLeft: arrow_size + "px solid " + layer_text_bgcolor 148 }); 149 } 150 else if (text_pos == "top") { 151 marginTop = (-1 * (chh3 + distance)) + 'px'; 152 left = '-' + ((chw3 - chw2) / 2) + 'px'; 153 right = 'auto'; 154 jQuery(this).find("span.hotspot_text_before").css({ 155 left: (chw3 / 2 - arrow_size) + "px", 156 bottom: "-" + arrow_size + "px", 157 borderLeft: arrow_size + "px solid transparent", 158 borderRight: arrow_size + "px solid transparent", 159 borderTop: arrow_size + "px solid " + layer_text_bgcolor 160 }); 161 } 162 else if (text_pos == "bottom") { 163 marginTop = (chw2 + distance) + 'px'; 164 left = '-' + ((chw3 - chw2) / 2) + 'px'; 165 right = 'auto'; 166 jQuery(this).find("span.hotspot_text_before").css({ 167 left: (chw3 / 2 - arrow_size) + "px", 168 top: "-" + arrow_size + "px", 169 borderLeft: arrow_size + "px solid transparent", 170 borderRight: arrow_size + "px solid transparent", 171 borderBottom: arrow_size + "px solid " + layer_text_bgcolor 172 }); 173 } 174 else if (text_pos == "left") { 175 marginTop = (-1 * ((chh3 - chw2) / 2)) + "px"; 176 left = 'auto'; 177 right = (chw2 + distance) + 'px'; 178 jQuery(this).find("span.hotspot_text_before").css({ 179 right: "-" + arrow_size + "px", 180 top: (chh3 / 2 - arrow_size) + "px", 181 borderTop: arrow_size + "px solid transparent", 182 borderBottom: arrow_size + "px solid transparent", 183 borderLeft: arrow_size + "px solid " + layer_text_bgcolor 184 }); 185 } 186 else if (text_pos == "right") { 187 marginTop = ((chw2 - chh3) / 2) + "px"; 188 left = (chw2 + distance) + 'px'; 189 right = 'auto'; 190 jQuery(this).find("span.hotspot_text_before").css({ 191 left: "-" + arrow_size + "px", 192 top: (chh3 / 2 - arrow_size) + "px", 193 borderTop: arrow_size + "px solid transparent", 194 borderBottom: arrow_size + "px solid transparent", 195 borderRight: arrow_size + "px solid " + layer_text_bgcolor 196 }); 197 } 198 jQuery(this).find(".wds_hotspot_text").css({ 199 marginTop : marginTop, 200 left : left, 201 right : right, 202 }); 203 204 /*var random = Math.random() * 10; 205 random = random.toFixed(2) + "s"; 206 jQuery(this).find("span:nth-child(2)").css({animationDelay: random, "-webkit-animation-delay": random});*/ 207 }); 208}
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.