Javascript Clickable而不是自动弹出

时间:2014-12-06 17:23:36

标签: javascript jquery

标题##美好的一天!我有这个JavaScript代码的问题。此代码适用于Pop Only。我在想,如何将其转换为可点击的图片。

这是我的图像代码

<li><a href="#"><i class="icon-envelope icon-2x"></i></a></li>

这是我弹出的javascript代码来自&#34; Klaviyo&#34;

<script type="text/javascript" src="//www.klaviyo.com/media/js/public/klaviyo_subscribe.js"></script>

    <script type="text/javascript">
    (document).ready(function(){
    $('icon-envelope icon-2x').on('click',function(){
 KlaviyoSubscribe.attachModalSignUp({
        list: 'g9cZtX',
        delay_seconds: 0.5,
        content: {
            clazz: ' klaviyo_modal_g9cZtX',
            header: "Interested in our Newsletter?",
            subheader: "Stay in the know with news and promotions.",
            button: "Subscribe",
            success: "Thanks! Check your email for a confirmation.",
            styles: '.klaviyo_modal.klaviyo_modal_g9cZtX {  font-family: "Helvetica Neue", Arial}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_header {  color:#222;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_subheader {  color:#222;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button span {  background-color:#07234F;  background-image: none;   border-radius: 2px;}.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button:hover,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_submit_button span:hover {  background-color:#2A4D85;  background-image: none; }.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_inner,.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_fieldset .klaviyo_field_group input[type=text],.klaviyo_modal.klaviyo_modal_g9cZtX .klaviyo_fieldset .klaviyo_field_group input[type=email] {  border-radius: 2px;}'
        }
    });
});
});
    </script>

我不确定我的错误在哪里。谢谢,

1 个答案:

答案 0 :(得分:0)

修复

(document).ready(function(){$(document).ready(function(){

$('icon-envelope icon-2x').on('click',function(){$('.icon-envelope').on('click',function(){