Note that there are some explanatory texts on larger screens.

plurals
  1. POSlide form on/off page and expand div
    primarykey
    data
    text
    <p>Ok this might be a little tricky but I'm sure it's doable. I have two buttons that I would like to trigger two forms with, initially the user would see the two buttons and one of the forms underneath, and when they click the other button a different form would slide in which is a little bigger than the first and expand the page/div to contain it. This is the HTML I have so far:</p> <pre><code>&lt;a href="#" class="msg medlightgreen large-6 columns"&gt;send us a message&lt;/a&gt; &lt;a href="#" class="quote medlightgreen large-6 columns"&gt;request free quote&lt;/a&gt; &lt;div class="msgform"&gt; &lt;form&gt; &lt;div class="row"&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="name"&gt; &lt;/div&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="phone"&gt; &lt;/div&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="e-mail"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="large-6 columns"&gt; &lt;input type="text" placeholder="monthly budget"&gt; &lt;/div&gt; &lt;div class="large-6 columns"&gt; &lt;input type="text" placeholder="timeframe"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="large-12 columns"&gt; &lt;textarea placeholder="message"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="quoteform"&gt; &lt;form&gt; &lt;div class="row"&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="name"&gt; &lt;/div&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="phone"&gt; &lt;/div&gt; &lt;div class="large-4 columns"&gt; &lt;input type="text" placeholder="e-mail"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="large-12 columns"&gt; &lt;textarea placeholder="message"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>I tried adding the following to the JS but doesn't seem to work:</p> <pre><code>$(document).ready(function() { $('.msg').click(function() { $(".msgform").slideToggle(200); }); $('.quote').click(function() { $(".quoteform").slideToggle(200); }); }); </code></pre> <p><img src="https://i.stack.imgur.com/7wn8a.jpg" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload