试图复制一个很好看的popover我穿过网上。jQuery不适用于弹出窗口
我似乎无法让我的jQuery工作。感觉我忽略了一些明显的东西。 (但是,是我把它,是的,我在Chrome浏览资源面板双击选中)
的jsfiddle:http://jsfiddle.net/3jsrk8n8/
HTML:
<div class="scpo_overlay"></div>
<div class="scpo_slidein"></div>
<div class="scpo_box">
<p id="scpo_title">You should really get this</p>
<p id="scpo_motivation">Because reasons. Undeniably good reasons</p>
<form action="https://www.skillcollector.com/sendy/subscribe" method="POST" accept-charset="utf-8" _lpchecked="1">
<input type="text" name="email" placeholder="Email">
<input type="hidden" name="list" value="lupC23UqZGvSWXHlVakRmQ" style="display:none">
<input type="submit" value="Send me the eBook!" name="Get the stuff!" onclick="ga('send', 'event', { eventCategory: 'Benefits', eventAction: 'Signup', eventLabel: 'Headerwell'});">
</form>
</div>
CSS:
.scpo_overlay {
position: fixed;
top: 0;
left: 0;
background-color: rgba(0,0,0,0.5);
height: 100%;
width: 100%;
z-index: 10;
}
.scpo_slidein {
position: fixed;
top: 0;
left: 0;
background-color: red;
width: 55%;
height: 100%;
z-index: 11;
}
.scpo_box {
position: fixed;
right: 0;
left: 0;
top: 50%;
transform: translateY(-50%);
text-align: center;
width: 100%;
z-index: 12;
}
.scpo_box #scpo_motivation, .scpo_box form {
display: inline-block;
padding: 0 5px;
}
的JavaScript:
$(function(){
$('.scpo_overlay').delay(500).fadeIn(400);
$('.scpo_slidein').delay(700).animate({left:0});
$('.scpo_box').delay(700).animate({right:0});
});
http://jsfiddle.net/3jsrk8n8/ –
你先生让我的工作变得更好。谢谢! – Mentor
更新,把它变成一个WordPress插件。感谢您的支持 :) – Mentor