Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make a div animation slide up and disappear?
    text
    copied!<p>I know this may sound like a basic question but the truth is I'm not that of an expert with animations and it's hard to calculate the math from x and y. So, I would like to know how to make the "gl_banner" div simply slide up after a 0.5-1 second(s) and disappear and the content below it will be pushed up to its original position. What css properties do I use? css-animation? transition? How do I do it?</p> <p>P.S. I did some research on animations and I saw a lot of animations, advanced animations but couldn't find a simple slide up animation. A little help is appreciated! Thanks!</p> <p><strong>HTML CODE:</strong></p> <pre><code>&lt;div id="gl_banner" style="display:none; visibility:hidden;"&gt;Good Luck! :)&lt;/div&gt; &lt;form id="quiz" action="grade.php" method="post" style="visibility:hidden;"&gt; &lt;!--Question 1--&gt; &lt;h3&gt;1. How many percent of modern camera phones use CMOS?&lt;/h3&gt; &lt;div&gt; &lt;input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" /&gt; &lt;label for="question-1-answers-A"&gt;A) 20%&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-1-answers" id="question-1-answers-B" value="B" /&gt; &lt;label for="question-1-answers-B"&gt;B) 80%&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-1-answers" id="question-1-answers-C" value="C" /&gt; &lt;label for="question-1-answers-C"&gt;C) 50%&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-1-answers" id="question-1-answers-D" value="D" /&gt; &lt;label for="question-1-answers-D"&gt;D) 90%&lt;/label&gt; &lt;/div&gt; &lt;!--Question 2--&gt; &lt;h3&gt;2. Which type of camera setting(s) is best for greater control and flexibility in terms of focusing on a subject?&lt;/h3&gt; &lt;div&gt; &lt;input type="radio" name="question-2-answers" id="question-2-answers-A" value="A" /&gt; &lt;label for="question-2-answers-A"&gt;A) Manual Focus&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-2-answers" id="question-2-answers-B" value="B" /&gt; &lt;label for="question-2-answers-B"&gt;B) Auto Focus&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-2-answers" id="question-2-answers-C" value="C" /&gt; &lt;label for="question-2-answers-C"&gt;C) Both A and B&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-2-answers" id="question-2-answers-D" value="D" /&gt; &lt;label for="question-2-answers-D"&gt;D) Neither&lt;/label&gt; &lt;/div&gt; &lt;!--Question 3--&gt; &lt;h3&gt;3. What are the three properties included in an exposure triangle?&lt;/h3&gt; &lt;div&gt; &lt;input type="radio" name="question-3-answers" id="question-3-answers-A" value="A" /&gt; &lt;label for="question-3-answers-A"&gt;A) White Balance, ISO, Low Light&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-3-answers" id="question-3-answers-B" value="B" /&gt; &lt;label for="question-3-answers-B"&gt;B) Shutter Speed, Exposure, ISO&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-3-answers" id="question-3-answers-C" value="C" /&gt; &lt;label for="question-3-answers-C"&gt;C) Aperture, ISO, Exposure&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-3-answers" id="question-3-answers-D" value="D" /&gt; &lt;label for="question-3-answers-D"&gt;D) ISO, Aperture, Shutter Speed&lt;/label&gt; &lt;/div&gt; &lt;!--Question 4--&gt; &lt;h3&gt;4. The higher the ISO, the more noise it produces in an image.&lt;/h3&gt; &lt;div&gt; &lt;input type="radio" name="question-4-answers" id="question-4-answers-A" value="A" /&gt; &lt;label for="question-4-answers-A"&gt;A) True&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-4-answers" id="question-4-answers-B" value="B" /&gt; &lt;label for="question-4-answers-B"&gt;B) False&lt;/label&gt; &lt;/div&gt; &lt;!--Question 5--&gt; &lt;h3&gt;5. What is the name of the smartphone you've seen all over this site?&lt;/h3&gt; &lt;div&gt; &lt;input type="radio" name="question-5-answers" id="question-5-answers-A" value="A" /&gt; &lt;label for="question-5-answers-A"&gt;A) Nokia Pureview 808&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-5-answers" id="question-5-answers-B" value="B" /&gt; &lt;label for="question-5-answers-B"&gt;B) Nokia Lumia 1020&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-5-answers" id="question-5-answers-C" value="C" /&gt; &lt;label for="question-5-answers-C"&gt;C) Nokia Lumia 925&lt;/label&gt; &lt;br/&gt; &lt;input type="radio" name="question-5-answers" id="question-5-answers-D" value="D" /&gt; &lt;label for="question-5-answers-D"&gt;D) Nokia Lumia 920&lt;/label&gt; &lt;/div&gt; &lt;br /&gt; &lt;hr style="border-top:1px; border-style:solid; border-color: #000;" /&gt; &lt;input style="cursor:pointer;" type="submit" value="Submit Quiz" /&gt; &lt;/form&gt; </code></pre> <p><strong>JavaScript Code:</strong></p> <pre><code>function takeQuiz() { // hide the intro document.getElementById('intro').style.display = 'none'; // display the quiz document.getElementById('quiz').style.visibility = 'visible'; document.getElementById('gl_banner').style.display = 'block'; document.getElementById('gl_banner').style.visibility = 'visible'; } </code></pre>
 

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