1

This is my current code and it pops up when clicked but i want to be able to have it pop up after being on the page for 10 seconds as well. Any guidance would be very helpful as i keep breaking it.

<script>
  $("#fixed-form-container .body").hide();
$("#fixed-form-container .button").click(function () {
        $(this).next("#fixed-form-container div").slideToggle(400);
        $(this).toggleClass("expanded");
    });
</script>
  • `setTimeout(function() { ... }, 10 * 1000 /* milliseconds */);` – blex May 13 '21 at 20:40
  • Use `setTimeout` inside a `window.onload = function() { }` function – Kinglish May 13 '21 at 20:42
  • I haev this now but it is not working onclick="myClick();" function myClick() { setTimeout( function() { document.getElementById('#fixed-form-container').style.display='none'; }, 1000); } $("#fixed-form-container .body").hide(); $("#fixed-form-container .button").click(function () { $(this).next("#fixed-form-container div").slideToggle(400); $(this).toggleClass("expanded"); }); – Austin Simpkins May 13 '21 at 21:12

0 Answers0