]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Add visual test page to show programmatic use of close triggers
authorGeoff Kimball <geoff@zurb.com>
Tue, 8 Mar 2016 22:43:20 +0000 (14:43 -0800)
committerGeoff Kimball <geoff@zurb.com>
Wed, 16 Mar 2016 16:42:37 +0000 (09:42 -0700)
test/visual/triggers/programmatic.html [new file with mode: 0644]

diff --git a/test/visual/triggers/programmatic.html b/test/visual/triggers/programmatic.html
new file mode 100644 (file)
index 0000000..29f958f
--- /dev/null
@@ -0,0 +1,42 @@
+<!doctype html>
+<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
+<html class="no-js" lang="en" dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>Foundation for Sites Testing</title>
+    <link href="../assets/css/foundation.css" rel="stylesheet" />
+  </head>
+  <body>
+    <div class="row column">
+      <h1>Triggers: Programmatic</h1>
+
+      <p>This callout uses a close button with <code>data-close</code>. Clicking it should close the callout.</p>
+
+      <div class="callout" data-closable>
+        <p>You can so totally close this!</p>
+        <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
+          <span aria-hidden="true">&times;</span>
+        </button>
+      </div>
+
+      <p>This callout uses a close button with a manual event handler that uses jQuery's <code>.trigger()</code> function.</p>
+
+      <div class="callout" data-closable id="testCallout">
+        <p>You can so totally close this!</p>
+        <button class="close-button" aria-label="Dismiss alert" type="button" id="testButton">
+          <span aria-hidden="true">&times;</span>
+        </button>
+      </div>
+    </div>
+
+    <script src="../assets/js/vendor.js"></script>
+    <script src="../assets/js/foundation.js"></script>
+    <script>
+      $(document).foundation();
+      $('#testButton').click(function() {
+        $('#testCallout').trigger('close');
+      });
+    </script>
+  </body>
+</html>