我需要找出wordpress的代码来创建一个自动出现的弹出窗口并将访问者发送到特定网站。
答案 0 :(得分:0)
<强> HTML:强>
<div class="socials">
<a href="https://twitter.com/" class="fa fa-twitter"></a>
<a href="https://www.facebook.com/" class="fa fa-facebook"></a>
<a href="https://www.google.com/" class="fa fa-google-plus"></a>
<a href="https://www.linkedin.com/" class="fa fa-linked-in"></a>
</div>
<强> JS:强>
$(document).ready(function() //when the document is ready load the function
{
$('.socials .fa').click(function(event) //when the object with both classes "fa" and "socials" is clicked
{
event.preventDefault(); //don't follow the URL as normal link!
window.open(this.href, "popupWindow", "width=600,height=600,scrollbars=yes"); //create pop up 600x600 with href of the link
});
});
不知道它是否会运行bootstrap,但它正在运行jQuery版本