自定义js的wordpress弹出窗体

时间:2015-06-17 22:33:31

标签: javascript php jquery css wordpress

我正在使用wordpress插件 - ICEGRAM在代码中添加自定义JS。我还在开始,非常感谢你的帮助。

基本上我把这个内联放在接受css,html和javadcript的插件页面上。我没有得到警报继续前进,可能有一百万个问题。是否有一些协议通过wordpress运行JavaScript?我应该在PHP中添加脚本标题还是什么???

这是我在弹出窗口上运行的内联代码.....

链接http://wolfsonwhites.com/wolfsonwhites/?campaign_preview_id=37

响应弹出窗口的代码;



<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">// <![CDATA[


$(document).click(function(e){

    var elem = $(e.target).attr('class');

$('.btn-find').click(function(){

    var h1 = $('.select-box').val();
    var w1 = $('.weight').val();

    if(h1 == 0){

        alert('select a damn height');
        window.location.replace = "http://google.com";

    } else if(h1 == 1){

        alert('you picked less than 5ft');

        if(w1 < 100){

            alert('you are small');

            window.location.href = "http://google.com";

        } else if(w1 < 160){

            alert('you are not bad');

        } else if (w1 < 200){

            alert('less than 200!!');

        } else {

            alert('you are really big');
        }

    } else if(h1 == 2){

        alert('you picked less than 5ft4');

        if(w1 < 100){

            alert('you are small');

        } else if(w1 < 160){

            alert('you are not bad');

        } else if (w1 < 200){

            alert('less than 200!!');

        } else {

            alert('you are really big');
        }

    } else if(h1 == 3){

        alert('you picked less than 5ft8');

        if(w1 < 100){

            alert('you are small');

        } else if(w1 < 160){

            alert('you are not bad');

        } else if (w1 < 200){

            alert('less than 200!!');

        } else {

            alert('you are really big');
        }

    } else {

        alert('over 5ft9');

        if(w1 < 100){

            alert('you are small');

        } else if(w1 < 160){

            alert('you are not bad');

        } else if (w1 < 200){

            alert('less than 200!!');

        } else {

            alert('you are really big');
        }

    }

});

// ]]></script>
&#13;
&nbsp;

&nbsp;
<div>
<div>

Select a Height:
<select class="select-box" name="Height">
<option value="0">Height...</option>
<option value="1">Less than 5ft</option>
<option value="2">5'0" - 5'2"</option>
<option value="3">5'3" - 5'5"</option>
<option value="4">5'6" - 5'8"</option>
<option value="5">5'9" - 5'11"</option>
<option value="6">6'0" - 6'2"</option>
<option value="7">6'3" - 6'5"</option>
</select>
<div style="height: 20px;"></div>
Enter your Weight:
<input class="weight" type="text" />
<div style="height: 20px;"></div>
Choose your Body Type:
<div class="your-size"></div>
<input class="btn-find" type="submit" value="Find" />
<div style="height: 20px;"></div>
</div>
</div>
&#13;
&#13;
&#13;

0 个答案:

没有答案