基本上,我想要做的是编辑下面的函数,以便<p>
标签包含内容“正在加载”,并且<span>
标签在标签中具有 data-icon 属性:
<p class="loadingp hidden">
loading
</p>
<span class="loadingspan hidden" data-icon=""></span>
功能是:
$(function(){
// add the loading div, but mark it as hidden
var loading = $('<div>', {'class': 'loading hidden'})
var loadingbg = $('<div>', {'class': 'loadingbg hidden'})
var loadingp = $('<p>', {'class': 'loadingp hidden'})
var loadingspan = $('<span>', {'class': 'loadingspan hidden'}).data('icon', '\ue022')
// append it
$('div.order').append(loading);
$('div.loading').append(loadingbg);
$('div.loadingbg').append(loadingp);
$('p.loadingp').append(loadingspan);
// now when we click the button launchg the pop up
$('button#complete').click(send_to_friend)
});