【发布时间】:2021-08-11 13:53:14
【问题描述】:
我正在使用 jQuery First Visit Popup (https://www.jqueryscript.net/lightbox/jQuery-Plugin-To-Show-A-Popup-Only-Once-Per-Visitor-First-Visit-Popup.html) 在有人第一次访问网页时向它添加一个弹出窗口。它工作正常。它只是一个带有消息的方框。点击X,它会消失,点击一个链接,它又回来了。非常好。但我希望能够在框中添加一个箭头,从右下角指向下方。
我在这里找到了“使用 CSS 在工具提示中添加箭头”,https://www.tutorialspoint.com/add-arrow-in-tooltip-with-css。我已经尝试但未能使用该代码来更改首次访问弹出窗口。 这是我使用的 CSS。
#fvpp-blackout {
display: none;
z-index: 199;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: #000;
opacity: 0.5;
}
#my-welcome-message {
display: none;
z-index: 500;
position: fixed;
width: 20%
left: 20%;
top: 60%;
padding: 20px 2%;
font-family: Calibri, Arial, sans-serif;
background: #282467;
border-radius: 6px;
color: green;
box-shadow: 0px 0px 5px #0003;
}
#fvpp-close {
position: absolute;
top: 10px;
right: 20px;
cursor: pointer;
}
#fvpp-dialog q {
font: 12px trebuchet ms,arial,helvetica,sans-serif;
color:#ffffff;
font-weight: bold;
margin:0px;
font-size: 2em;
}
在javascript和html中是
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/jquery.firstVisitPopup.js"></script>
<script type="text/javascript">
$('#my-welcome-message').firstVisitPopup({
cookieName : 'homepage',
showAgainSelector: '#show-message'
});
</script>
<div id="my-welcome-message" >
<h1>My Message</h1>
<h1>Hover over the colored dots for more information.</h1>
</div>
【问题讨论】:
标签: javascript html jquery css popup