Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit e77c720

Browse files
author
Gabriel Schulhof
committed
Demos: Popup widget: Add arrow demo.
1 parent 2e33999 commit e77c720

File tree

2 files changed

+25
-76
lines changed

2 files changed

+25
-76
lines changed

demos/examples/popups/arrow.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

demos/widgets/popup/index.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212
<script src="../../_assets/js/"></script>
1313
<script src="../../../js/"></script>
1414
</head>
15+
<style id="popup-arrow-css">
16+
.clickable-area {
17+
display: block;
18+
width: 100%;
19+
height: 300px;
20+
background-color: #ffefef;
21+
}
22+
</style>
23+
<script id="popup-arrow-script">
24+
$.mobile.document.on( "click", "#open-popupArrow", function( evt ) {
25+
$( "#popupArrow" ).popup( "open", { x: evt.pageX, y: evt.pageY } );
26+
evt.preventDefault();
27+
});
28+
</script>
1529
<body>
1630
<div data-role="page" class="jqm-demos" data-quicklinks="true">
1731

@@ -274,6 +288,17 @@
274288
</div>
275289
</div><!--/demo-html -->
276290

291+
<h2>Arrow</h2>
292+
<p>The popup can display an arrow along one of its edges when it opens if the <code>data-arrow</code> attribute is set. The attribute can take a value of <code>true</code>, <code>false</code>, or a string containing a comma-separated list of edge abbreviations ("l" for left, "t" for top, "r" for right, and "b" for bottom). For example, if you set <code>data-arrow="r,b"</code> then the arrow will only ever appear along the bottom or right edge of the popup. <code>true</code> is the same as <code>"l,t,r,b"</code> and <code>false</code> or <code>""</code> indicates that the popup should be displayed without an arrow.</p>
293+
<p>Click in the pink area below to display a popup with an arrow.</p>
294+
<div data-demo-html="true" data-demo-css="#popup-arrow-css" data-demo-js="#popup-arrow-script">
295+
<div data-role="popup" id="popupArrow" data-arrow="true">
296+
<p>A paragraph inside the popup with an arrow.</p>
297+
<p>This second paragraph serves to increase the height of the popup</p>
298+
</div>
299+
<a href="#" id="open-popupArrow" class="clickable-area"></a>
300+
</div>
301+
277302
<h2>Pre-rendered markup</h2>
278303
<p>You can supply pre-rendered popup markup to save startup time. The page in the example below contains a popup with pre-rendered markup supplied as part of the original page markup.</p>
279304
<div data-demo-html="#pre-rendered-page">

0 commit comments

Comments
 (0)