如何为wordpress创建一个弹出窗口,自动将访问者重定向到另一个站点?

时间:2016-08-11 14:00:29

标签: html wordpress

我需要找出wordpress的代码来创建一个自动出现的弹出窗口并将访问者发送到特定网站。

1 个答案:

答案 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版本