From dacb562b82efa22100c5de4418264aca1556102a Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Sun, 5 Apr 2015 18:47:16 +0000 Subject: [PATCH] Adds div hide to show_more() 1) third arguement will hide div on click or submit 2) another user enhancement --- js/contact.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/contact.js b/js/contact.js index 1c055ec..318823a 100644 --- a/js/contact.js +++ b/js/contact.js @@ -155,10 +155,11 @@ $(function(){ // show more button - function show_more(demo,demo_button) { + function show_more(demo,demo_button,div_click) { $(demo).hide(); var c=0; var button_value = demo_button.val(); + // button $(demo_button).click(function(e){ e.preventDefault(); if (c == 0) { @@ -170,10 +171,18 @@ $(function(){ $(this).attr("value",button_value); c--; } - } ); + } ); + // div + if (div_click) { + $(div_click).on("click submit", function(e){ + $(this).hide(); + $(demo_button).attr("value",button_value); + c = 0; + } ); + } } - show_more($('#waiver'),$('#waiver_button')); + show_more($('#waiver'),$('#waiver_button'),$('#waiver')); show_more($('#interest_form'),$('#interest_form_button')); $("#email_list_toggle").on("set",function() {