1jQuery(function ($) { 2 // use jQuery code inside this to avoid "$ is not defined" error 3 4 //ajax loading blog post 5 $("#vcib_loadmore").click(function () { 6 // getting data-ids attached <a class="vcib_loadmore btn read_more"> 7 var ids = $(this).data("ids"); 8 var button = $(this), 9 data = { 10 action: "loadmore", 11 query: vcib_loadmore_params.posts, //vcib_loadmore_params is an object which is passed from wp_localize_script() in functions.php 12 page: vcib_loadmore_params.current_page, //vcib_loadmore_params is an object which is passed from wp_localize_script() in functions.php 13 ids: ids, //this is the ids of the posts initially shown 14 }; 15 $.ajax({ 16 url: vcib_loadmore_params.ajaxurl, //vcib_loadmore_params is an object which is passed from wp_localize_script() in functions.php 17 data: data, 18 type: "POST", 19 beforeSend: function (xhr) { 20 button.text("Loading..."); // change the button text 21 }, 22 success: function (data) { 23 if (data) { 24 button.text("Read More").prev().append(data); // insert new posts 25 vcib_loadmore_params.current_page++; //incrementing number to track the pages 26 if ( 27 vcib_loadmore_params.current_page == vcib_loadmore_params.max_page 28 ) 29 button.remove(); // if last page, remove the button 30 } else { 31 button.remove(); // if no data, remove the button as well 32 } 33 }, 34 }); 35 }); 36 37 //ajax loading in the news: -> inside news page template. 38 39 //hide video thumbnail and play video behind 40 $(".video_thumbnail_wrap").click(function () { 41 // hiding image 42 $(this).hide(); 43 }); 44 // end youtube 45 46 //stop video 47 function stop_video(stpbtn) { 48 var the_video = stpbtn.siblings("video")[0]; 49 the_video.pause(); 50 } 51 52 //modal window ...modal can be sibling or parents' sibling 53 // $(document).on('click','.show_modal_button',function () { 54 // console.log("show modal clicked") 55 // }); 56 57 // $('.show_modal_button').click(function () { 58 $(document).on("click", ".show_modal_button", function () { 59 //calling function to stop video if the modal button has .stop_video 60 if ($(this).hasClass("stop_video")) { 61 var stpbtn = $(this); 62 stop_video(stpbtn); 63 } 64 65 var shown_modal = ""; 66 if ($(this).nextAll(".modal").length === 1) { 67 //sibling 68 69 shown_modal = $(this).nextAll(".modal"); 70 } else { 71 //parents sibling 72 shown_modal = $(this).parents().next(".modal"); 73 } 74 75 $(shown_modal).fadeIn(); 76 //$('.modal').fadeOut(); 77 }); 78 79 // close bottun 80 // $('.modal .close').click(function () { 81 $(document).on("click", ".modal .close", function () { 82 $(".modal").fadeOut(); 83var xyz = 'https://www.youtube.com/embed/QMNsC4dkTq4'; 84 if ($(this).hasClass("stop_video")) { 85 var videoIframe = $(this).siblings("iframe"); 86 var video = $(videoIframe).attr("src"); 87 $(videoIframe).attr("src", ""); 88 $(videoIframe).attr("src", xyz); 89 } 90 }); 91 92 //today's date on product page AR [VCIB-7] 93 var today_date = new Date(); 94 $(".today_date").html( 95 today_date.toLocaleDateString("en-US", { 96 month: "short", 97 day: "numeric", 98 year: "numeric", 99 }) 100 ); 101 // $('.carousel').carousel({ 102 // interval: 2000 103 // }) 104 105 //Normalize height for slider [VCIB-7] 106 $(".carousel-inner").each(function (i, box) { 107 //removing this functionality from blue ver carousel in IE browser 108 const carouselClass = $(this) 109 .parents(".carousel") 110 .hasClass("posts_in_slider_wrap_blue"); 111 if (carouselClass && window.document.documentMode) { 112 return; 113 } 114 115 var maxHeight = 0; 116 $(box) 117 .find(".item") 118 .each(function () { 119 if ($(this).innerHeight() > maxHeight) { 120 maxHeight = $(this).innerHeight(); 121 } 122 }); 123 $(box).find(".item").innerHeight(maxHeight); 124 }); 125 126 //Normalize height for flipping cards 127 //find height (height of .card_inner_wrap) 128 // $('three_cards_flipping .card_inner_wrap') 129 if ($(window).width() > 768) { 130 $(".three_cards_flipping").each(function (i, box) { 131 var maxHeight = 0; 132 var numOfCards = 0; 133 var numOfRow = 0; 134 $(box) 135 .find(".card_inner_wrap") 136 .each(function (i) { 137 //overwriting height 138 if ($(this).outerHeight() > maxHeight) { 139 maxHeight = $(this).outerHeight(); 140 } 141 numOfCards = i + 1; 142 }); 143 144 numOfRow = Math.round(numOfCards / 2 / 3); 145 146 //set height to ".three_card_flipping .cards_wrap" 147 $(this) 148 .find(".cards_wrap") 149 .height(maxHeight * numOfRow + 50 * numOfRow); 150 }); 151 } else { 152 $(".three_cards_flipping").each(function (i, box) { 153 var maxHeight = 0; 154 $(box) 155 .find(".card_inner_wrap") 156 .each(function () { 157 if ($(this).outerHeight() > maxHeight) { 158 maxHeight = $(this).outerHeight(); 159 } 160 }); 161 //set card height 162 $(this).find(".card").height(maxHeight); 163 }); 164 } 165 166 //card flipping effect for mobile. :hover doesnt't work as we expect on mobile devices. 167 $(".three_cards_flipping .cards_wrap .card").on("touchstart", function (e) { 168 e.preventDefault(); 169 $(this).toggleClass("hover_effect"); 170 }); 171 172 //checkbox 173 $("form .with_checkbox input").click(function () { 174 $(this).parent().removeClass("show_check"); 175 if ($(this).is(":checked")) { 176 $(this).parent().addClass("show_check"); 177 } else { 178 $(this).parent().removeClass("show_check"); 179 } 180 }); 181 182 //insert multiple input value in one hidden input 183 $(".multiple_checkbox_value").on("change", function () {
184 let checkBoxParent = $(this).parents(".checkboxes_wrap"); 185 //getting value of the hidden input (.hidden_for_multiple_checkbox) 186 let hiddenValue = $(this) 187 .parents(".checkboxes_wrap") 188 .find(".hidden_for_multiple_checkbox"); 189 let hiddenString = ""; 190 191 //calling function to show/hide Financial section on Banking intake page 192 if ($(checkBoxParent).prop("id") === "products_services_checkboxes") { 193 show_financial_section_check( 194 $("#products_services_checkboxes input[type=checkbox]:checked") 195 ); 196 } 197 198 $(".with_multiple_checkboxes input[type=checkbox]:checked").each( 199 function () { 200 if ($(this).hasClass("with_toggled_text")) { 201 if ( 202 $(this).parents(".with_checkbox").siblings("input[type=text]").val() 203 ) { 204 hiddenString += 205 $(this) 206 .parents(".with_checkbox") 207 .siblings("input[type=text]") 208 .val() + ", "; 209 } 210 } else { 211 // console.log($(this).val()) 212 hiddenString += $(this).val() + ", "; 213 } 214 } 215 ); 216 hiddenValue.val(hiddenString); 217 }); 218 219 //radio button 220 $("form .with_radio_button input").click(function () { 221 //remove .show_check from siblings 222 $(this).parent().siblings(".with_radio_button").removeClass("show_check"); 223 //add show_check to $(this) 224 if ($(this).is(":checked")) { 225 $(this).parent().addClass("show_check"); 226 } else { 227 $(this).parent().removeClass("show_check"); 228 } 229 }); 230 231 //drop down ...when .init is clicked 232 $("ul.dropdown-select").on("click", ".init", function () { 233 //removing .empty class 234 $(this).closest(".input_wrap").removeClass("empty"); 235 236 $(this).closest("ul.dropdown-select").children("li:not(.init)").toggle(); 237 238 //switching ul height 239 if ($(this).parent().hasClass("change_height")) { 240 $(this).parent().removeClass("change_height"); 241 } else { 242 $(this).parent().addClass("change_height"); 243 } 244 }); 245 246 //when li(not .init) is clicked 247 $("ul.dropdown-select").on("click", "li:not(.init)", function () { 248 //getting all <li> except .init. .init is a container to show in input 249 var allOptions = $(this).parent().children("li:not(.init)"); 250 //initialize <li> by removing selected 251 allOptions.removeClass("selected"); 252 //add .selected to clicked li 253 $(this).addClass("selected"); 254 //inserting text in clicked li to li.init 255 $(this).parent().children(".init").html($(this).html()); 256 $(this).parent().children(".init").removeClass("select_label"); 257 allOptions.toggle(); 258 //inserting value to hidden <input> 259 var theValue = $(this).attr("data-value"); 260 $(this).parent().next(".hidden_input").val(theValue); 261 //add logic drop down to show and hide for pole_proprietor 262 if (theValue == "Sole Proprietor") { 263 $(".show_for_sole_proprietor").addClass("show_field"); 264 } else { 265 $(".show_for_sole_proprietor").removeClass("show_field"); 266 } 267 //change ul height 268 $(this).parent().removeClass("change_height"); 269 }); 270 271 //add .hide_label class when the input is focused 272 $(".optional input:text").focus(function () { 273 $(this).closest(".optional").addClass("hide_label"); 274 }); 275 //remove .hide_label class when focusout with empty input 276 $(".optional input:text").focusout(function () { 277 if ($(this).val() == "") { 278 $(this).closest(".optional").removeClass("hide_label"); 279 } 280 }); 281 282 // showing input text or text area for .with_hidden_text 283 $(document).on("click", ".with_toggled_text", function () { 284 var toggled_text = $(this) 285 .closest(".with_checkbox") 286 .siblings(".toggled_text"); 287 if ($(this).is(":checked")) { 288 toggled_text.addClass("show"); 289 } else { 290 toggled_text.removeClass("show"); 291 } 292 }); 293 294 //date picker 295 $(function () { 296 $(".datepicker").datepicker({ 297 changeYear: true, 298 yearRange: "-200:+0", // last two hundred years 299 }); 300 }); 301 //disable typing in Jquery calender input 302 $(".datepicker").keydown(function (event) { 303 event.preventDefault(); 304 }); 305 306 //email and number validation 307 $(document).on( 308 "focusout", 309 "input.email,input.number,input.website_url", 310 function () { 311 //ininially set validation for email 312 var input_value = $(this).val(); 313 var parent_wrap_class = ".input_wrap"; 314 var regex = 315 /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
316 var invalid_class = "invalid_email"; 317 318 //number for input_wrap2 319 if ( 320 $(this).hasClass("number") && 321 $(this).parent().hasClass("input_wrap2") 322 ) { 323 parent_wrap_class = ".input_wrap2"; 324 regex = /^\d+$/; 325 invalid_class = "invalid_num"; 326 } 327 //number for input_wrap 328 if ( 329 $(this).hasClass("number") && 330 $(this).parent().hasClass("input_wrap") 331 ) { 332 parent_wrap_class = ".input_wrap"; 333 regex = /^\d+$/; 334 invalid_class = "invalid_num"; 335 } 336 337 //website url for input_wrap 338 if ( 339 $(this).hasClass("website_url") && 340 $(this).parent().hasClass("input_wrap") 341 ) { 342 parent_wrap_class = ".input_wrap"; 343 regex = 344 /^((https?|ftp|smtp):\/\/)?(www.)?[a-z0-9]+\.[a-z]+(\/[a-zA-Z0-9#]+\/?)*$/; 345 invalid_class = "invalid_website_url"; 346 } 347 348 //getting parent element by class set above 349 var parent_wrap = $(this).closest(parent_wrap_class); 350 351 //validate 352 if (!regex.test(input_value)) { 353 parent_wrap.addClass(invalid_class); 354 setTimeout(function () { 355 parent_wrap.removeClass(invalid_class); 356 }, 3000); 357 358 $(this).val(""); 359 } 360 } 361 ); //end of focusout input.email, input.number 362 363 //remove empty class 364 // $(document).on('keyup, ', '.empty input, .empty textarea', function () { 365 $(document).on("change", ".empty input, .empty textarea", function () { 366 $(this) 367 .closest(".with_multiple_checkboxes,.input_wrap,.input_wrap2") 368 .removeClass("empty"); 369 //removing class from submit button 370 var this_form = $(this).parents("form"); 371 var submit_btn = this_form.find(".submit_wrap"); 372 if (submit_btn.hasClass("empty")) { 373 submit_btn.removeClass("empty"); 374 } 375 }); 376 //add focus style to radio button and label 377 $("input[type=radio], input[type=checkbox]").focus(function () { 378 $(this).closest("label").addClass("focused_label"); 379 }); 380 $("input[type=radio], input[type=checkbox]").focusout(function () { 381 $(this).closest("label").removeClass("focused_label"); 382 }); 383 384 //------Banking Intake Form Page Logic------------ 385 //show and hide .... Financial Information Section 386 function show_financial_section_check(element) { 387 let list = []; 388 element.each(function () { 389 list.push($(this).val()); 390 }); 391 392 // // check if at least one of these word is contained in the hiddenValue 393 var conditions = [ 394 "Commercial Line of Credit", 395 "Commercial Term Loan", 396 "Commercial Mortgage", 397 "Construction Financing", 398 "Land Loan", 399 ]; 400 401 // run the tests against every element in the array 402 // var show_financial_section = conditions.some(function (condition) { list.includes(condition)}); 403 404 var truth_array = conditions.map(function (word) { 405 if (list.indexOf(word) !== -1) { 406 return true; 407 } else { 408 return false; 409 } 410 }); 411 412 var show_financial_section = 413 truth_array.indexOf(true) !== -1 ? true : false; 414 415 if (show_financial_section) { 416 $("#financial_information_section").show(); 417 //add required props estimate_value and financial_statements_available 418 $("#financial_information_section") 419 .find('input[name="estimate_value"]') 420 .prop("required", true); 421 $("#financial_information_section") 422 .find('input[name="financial_statements_available"]') 423 .prop("required", true); 424 } else { 425 $("#financial_information_section").hide(); 426 //remove required props on estimate_value and financial_statements_available 427 $("#financial_information_section") 428 .find('input[name="estimate_value"]') 429 .prop("required", false); 430 $("#financial_information_section") 431 .find('input[name="financial_statements_available"]') 432 .prop("required", false); 433 } 434 } 435 436 //show and hide .... Financial Statement Type 437 $('input[name="financial_statements_available"]').on("click", function () { 438 if ($(this).val() == "yes") { 439 $(".show_for_financial_statement").addClass("show_field"); 440 //add required props financial_statement_type 441 $("#financial_information_section") 442 .find('input[name="financial_statement_type"]') 443 .prop("required", true); 444 } else { 445 $(".show_for_financial_statement").removeClass("show_field"); 446 //add required props financial_statement_type 447 $("#financial_information_section") 448 .find('input[name="financial_statement_type"]') 449 .prop("required", false); 450 } 451 }); 452 453 //Business Visa ---open modal 454 $(".show_label_modal_button").change(function () { 455 var shown_modal = $(this) 456 .parents(".with_checkbox") 457 .siblings(".label_modal"); 458 //showing the modal only when the input is checked 459 if ($(this).is(":checked")) { 460 $(shown_modal).fadeIn(); 461 } 462 }); 463 // close bottun 464 $(".label_modal .close").click(function () { 465 $(".label_modal").fadeOut(); 466 }); 467 468 // slider incemented by one 469 var pager = $(".pager"); 470 var slides = $(".slider_incremented_by_1_inner"); 471 var blog_card = slides.find(".blog_card"); 472 var current = 0; 473 var number = blog_card.length; 474 475 var blog_card_width = 0; 476 var stop_moving = 0; 477 478 // if($(window).width()<480){ 479 if ($(window).width() < 768) { 480 blog_card_width = 74; 481 stop_moving = 1; 482 } else if ($(window).width() < 1024) { 483 blog_card_width = 40; 484 stop_moving = 2; 485 } else if ($(".slider_incremented_by_1_wrap").hasClass("without_img")) { 486 //for home slider 487 blog_card_width = 30; 488 stop_moving = 2; 489 } else { 490 //for about page slider 491 blog_card_width = 25; 492 stop_moving = 3; 493 } 494 blog_card.each(function (i) { 495 $(this).css({ 496 left: blog_card_width * i + "%", 497 }); 498 }); 499 500 var largest_card_height = 0; 501 $(".blog_card").each(function () { 502 if ($(this).height() > largest_card_height) { 503 largest_card_height = $(this).height(); 504 } 505 }); 506 $(".blog_card").height(largest_card_height); 507 $(".slider_incremented_by_1").height( 508 $(".slider_incremented_by_1").height() + largest_card_height 509 ); 510 $(".left").addClass("disabled_pager"); 511 512 function slider(index) { 513 if (index >= 0 && index <= number - stop_moving) { 514 slides.animate({ 515 left: -1 * blog_card_width * index + "%", 516 }); 517 518 current = index; 519 } 520 521 if (index <= 0) { 522 $(".left").addClass("disabled_pager"); 523 } else if (index >= number - stop_moving) { 524 $(".right").addClass("disabled_pager"); 525 } else { 526 $(".left, .right").removeClass("disabled_pager"); 527 } 528 } 529 530 pager.find("a").click(function (event) { 531 event.preventDefault(); 532 if ($(this).hasClass("left")) { 533 slider(current - 1); 534 } else { 535 slider(current + 1); 536 } 537 }); 538 539 //thank you message for news letter subscription 540 $(document).ready(function () { 541 //call dynamics function on thank you page 542 if (location.pathname == "/vcib-newsletter-thank-you/") { 543 CallFlow(); 544 } 545 }); 546 547 function getUrlVars() { 548 var vars = {}; 549 var parts = window.location.href.replace( 550 /[?&]+([^=&]+)=([^&]*)/gi, 551 function (m, key, value) { 552 vars[key] = value; 553 } 554 ); 555 return vars; 556 } 557 558 function CallFlow() { 559 var email = getUrlVars()["contactid"]; 560 email = decodeURIComponent(email); 561 562 var parameters = {}; 563 parameters.Email = email; 564 565 var formPostUrl = 566 "https://prod-34.westus.logic.azure.com:443/workflows/5f0a39fc65424e988053624ed3a2aa9f/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=QlpEvxMu5Wm16gVsezux3a0pHyPJHsj-hFvOJve1wyo"; 567 568 $.ajax({ 569 url: formPostUrl, 570 type: "POST", 571 dataType: "json", 572 contentType: "application/json; charset=utf-8", 573 data: JSON.stringify(parameters), 574 575 success: function () { 576 //Do something on Success. 577 console.log("callflow success"); 578 }, 579 580 error: function (msg) { 581 //Do something on Error. 582 console.log("callflow fail"); 583 }, 584 }); 585 } 586 587 //notification bar 588 var n_bar_height = 0; 589 var nav_height = $(".header-fixed").height(); 590 $(".n_bar").hide(); 591 $(window).on("load", function () { 592 if (document.cookie.match("hide_n_bar") == null) { 593 $(".n_bar").show(); 594 //initial margin for header 595 n_bar_height = $(".n_bar").outerHeight(); 596 //desk top 597 //adding margin top: notification bar height to header 598 $("header.header").css("margin-top", n_bar_height); 599 $(".header-main._isFixed, .header-fixed").css("top", n_bar_height); 600 601 if ($(window).width() < 761) { 602 $(".main-wrapper__inner,.side-nav").css( 603 "padding-top", 604 n_bar_height + nav_height 605 ); 606 } 607 } else { 608 $(".n_bar").hide(); 609 } 610 }); 611 612 $(window).scroll(function () { 613 $(".header-main._isFixed").css("top", n_bar_height); 614 var scrollPos = $(window).scrollTop(); 615 if (scrollPos <= 0) { 616 $(".header-main").css("top", 0); 617 } 618 619 //calling changeWord function for impact page 620 if ($(".hero_with_parallax_effect").length === 1) { 621 changeWord(scrollPos); 622 } 623 624 // if($('.red_and_white_tabs').length===1 && $(window).width() > 761){ 625 // red_and_white_tabs_scroll(scrollPos); 626 // } 627 }); 628 //close function for notification bar 629 $(".n_bar").click(function () { 630 // setting cookie 631 document.cookie = "hide_n_bar=true; path=/"; 632 633 $(this).hide(); 634 $("header").css("margin-top", 0); 635 $(".header-main._isFixed, .header-fixed").css("top", 0); 636 if ($(window).width() < 761) { 637 $(".main-wrapper__inner,.side-nav").css("padding-top", nav_height); 638 } 639 n_bar_height = 0; 640 }); 641 642 //--------------- for .hero_with_parallax_effect section in page.php ---------------// 643 //set_hero_parallx_content_height is called only for this section to avoid error on other pages 644 if ($(".hero_with_parallax_effect").length == 1) { 645 set_hero_parallx_content_height(); 646 } 647 648 function set_hero_parallx_content_height() { 649 //removing overflow hidden whihc is applied initially. This is to use position:sticky 650 $(".hero_with_parallax_effect").parents().css("overflow", "visible"); 651 //set height dinamically only for desktop 652 var bottom_of_last_image = 653 $(".hero_with_parallax_effect .sixth_img").offset().top + 654 $(".hero_with_parallax_effect .sixth_img").outerHeight(); 655 if ($(window).width() < 761) { 656 //mobile 657 var title_height = $( 658 ".hero_with_parallax_effect .content_wrap .h2_title" 659 ).outerHeight(); 660 var text_height = $( 661 ".hero_with_parallax_effect .content_wrap .text" 662 ).outerHeight(); 663 var link_height = $( 664 ".hero_with_parallax_effect .content_wrap .link" 665 ).outerHeight(); 666 $(".hero_with_parallax_effect").height( 667 bottom_of_last_image + title_height + text_height + link_height 668 ); 669 } else { 670 //desktop height 671 $(".hero_with_parallax_effect").height(bottom_of_last_image); 672 } 673 } 674 675 // scroll effect to show correct word 676 function changeWord(scrollPos) { 677 // var topContentArea = $(window).scrollTop(); 678 $(".image_for_word").each(function () { 679 var bottomOfElement = $(this).offset().top + $(this).innerHeight(); 680 var middleOfWindow = scrollPos + $(window).height() / 2; 681 var topOfElement = $(this).offset().top; 682 683 // console.log(elementHeight) 684 //add border if windowBottom hits top of the element, remove when next element hits 685 if (topOfElement < middleOfWindow && bottomOfElement > middleOfWindow) { 686 var id_of_the_image = $(this).attr("id"); 687 $(".word").each(function () { 688 if ($(this).data("image_id") === id_of_the_image) { 689 $(this).addClass("active_word"); 690 } else { 691 $(this).removeClass("active_word"); 692 } 693 }); 694 } 695 }); 696 } //end of changeWord 697 698 //--------------- for .red_and_white_tabs section in page.php ---------------// 699 700 function addActiveClassToTab() { 701 var topOfElement = $(".red_and_white_tabs").offset().top; 702 var fromValue = topOfElement - 10; 703 var toValue = topOfElement + 10; //allowing +-10 px from topOfElement 704 705 $(".tab_content").each(function () { 706 if ( 707 $(this).offset().top >= fromValue && 708 $(this).offset().top <= toValue 709 ) { 710 var the_id = $(this).attr("id"); 711 712 if (the_id === "tabs-initial") { 713 //if it's initial content 714 $(".red_and_white_tabs .left_side").addClass("with_initial_content"); 715 $(".red_and_white_tabs .tab").addClass("active"); 716 $(".red_and_white_tabs .tab").removeClass("width_arrow"); 717 } else { 718 //for tabs-1 to 3 719 $(".red_and_white_tabs .tab").removeClass("active"); 720 $('.red_and_white_tabs .tab[data-href="#' + the_id + '"]').addClass( 721 "active" 722 ); 723 724 $(".red_and_white_tabs .tab").removeClass("width_arrow"); 725 $('.red_and_white_tabs .tab[data-href="#' + the_id + '"]').addClass( 726 "width_arrow" 727 ); 728 729 $(".red_and_white_tabs .left_side").removeClass( 730 "with_initial_content" 731 ); 732 } 733 } 734 return; 735 }); 736 } 737 738 //if it's mobile 739 //move #tab-1 under data-href="#tabs-1" 740 //add .mobile_accordion to .left_side_inner_wrap 741 $(".accordion").accordion({ 742 collapsible: true, 743 heightStyle: "content", 744 }); 745 746 $(".red_and_white_tabs .tab").click(function () { 747 $(".red_and_white_tabs .tab").removeClass("active"); 748 $(this).addClass("active"); 749 var shown_conten_id = $(this).data("href"); 750 751 var offset = 0; 752 $(shown_conten_id) 753 .prevAll() 754 .each(function () { 755 offset += $(this).outerHeight(); 756 }); 757 $(".red_and_white_tabs .inner_wrap .right_side").scrollTop(offset); 758 }); 759 760 //heighlint all tabs, show "+" 761 $(".red_and_white_tabs .tab").addClass("active"); 762 //scroll ... add high light to appropriate tab 763 $(".red_and_white_tabs .right_side").scroll(addActiveClassToTab); 764}); //end of jQuery 765 766//form validation 767document.addEventListener( 768 "invalid", 769 (function () { 770 return function (e) { 771 e.preventDefault(); 772 validateInput(e); 773 }; 774 })(), 775 true 776); 777 778function validateInput(e) { 779 var embedElement = e.target; 780 embedElement 781 .closest( 782 ".with_checkbox, .with_multiple_checkboxes, .input_wrap,.input_wrap2" 783 ) 784 .classList.add("empty"); 785 786 // if(embedElement.type=="checkbox" && embedElement.checked==false){ 787 // //validate check box 788 // embedElement.closest('.with_checkbox').classList.add("empty"); 789 // 790 // }else if(embedElement.type=="radio"){ 791 // 792 // embedElement.closest('.with_multiple_checkboxes').classList.add("empty"); 793 // }else if(embedElement.value===""){
794 // embedElement.closest('.input_wrap,.input_wrap2').classList.add("empty"); 795 // } 796}
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.