Created
December 27, 2016 23:38
-
-
Save matchy256/2022fbc0d4b80a0d85780a1093edef6b to your computer and use it in GitHub Desktop.
jQuery Mobile 1.4系で簡易なポップアップメッセージ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jqmSimpleMessage(message) { | |
var parent = $('.ui-page-active'); | |
if (parent.length === 0) { | |
parent = $('body'); | |
} | |
var div = $('<div data-role="popup" id="__popupmsg" class="ui-content" data-theme="a"></div>'); | |
div.append($('<p></p>').text(message)); | |
var a = $('<a href="#__popupmsg" data-rel="popup" data-position-to="window" id="__popupkicker">popup</a>'); | |
a.css('display', 'none'); | |
parent.append(div).trigger('create'); | |
parent.append(a).trigger('create'); | |
$('#__popupkicker').click().remove(); | |
div.delay(800).fadeOut(400, function(){ | |
$(this).remove(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment