如何解决如何使脚本显示为模态?
我目前正在使用PyCharm作为IDE,并且正在关注youtube上的一些教程以进行学习。如您所见,我非常新。以下脚本(代码1)不起作用,它引用的是模式(代码2)。该脚本应在到达时在屏幕上显示模式弹出窗口,而不是在底部显示弹出窗口或根本不显示弹出窗口。通过FastAPI显示。
代码1(脚本)
<script>
$(document).ready(function() {
$('.ui.modal').modal('show');
});
</script>
代码2(指:)
<<div class="ui modal">
<i class="close icon"></i>
<div class="header">
Profile Picture
</div>
<div class="description">
<div class="ui header">We've auto-chosen a profile image for you.</div>
<p>We've grabbed the following image from the <a href="https://www.gravatar.com" target="_blank">gravatar</a> image associated with your registered e-mail address.</p>
<p>Is it okay to use this photo?</p>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Nope
</div>
<div class="ui positive right labeled icon button">
Yep,that's me
<i class="checkmark icon"></i>
</div>
</div>
</div>
我希望得到这样的结果:
但是我得到了这个(忽略实际文本,因为文本不同):
由于可能与格式化有关,因此您可以在这里看到编码时看到的内容。
尽管我很新,但我需要为javascript安装一些软件包才能正常工作。我的JavaScript库中有@ types / bootstrap和@ types / jquery。我不知道那里是否出了什么问题,因为我复制了the tutorial,但仍然没有得到结果。
我也尝试过线路
<script>
$(document).ready(function() {
$('.ui.modal').modal({show:true});
});
</script>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。