【发布时间】:2013-06-07 00:08:05
【问题描述】:
大家好,我正在使用 jquery 作为 wordpress 的灯箱效果弹出窗口。我在 Wamp Server 中尝试过工作正常(本地主机),但是今天只有我们没有从 jquery 得到任何输出我用 firebug 的控制台检查了它的 throws 语法错误我不确定我做错了什么我为你提供了你可以的代码查看它并告诉我我在哪里做错了。
<script type="text/javascript">
jQuery(document).ready(function($){
if(jQuery.cookie('popup_user_login')!='yes'){
<?php if ($_COOKIE['test']!='5') {?>
jQuery('#ptechsolfb').delay(<?php echo get_option('popup_template_delay');?>).fadeIn('medium');<?php
if(get_option('popup_delay_auto')=='1') { ?> function countDown(i) {
var int = setInterval(function () {
document.getElementById("ptechsolin").innerHTML = "You Must Wait Until the Timer Ends " + i;
i-- || clearInterval(int) || jQuery('#ptechsolfb').stop().fadeOut('medium') ;
//if i is 0, then stop the interval
}, 1000);
}
countDown(<?php echo get_option('popup_template_count');?>);
<?php } ?> <?php if(get_option('close_esckey_ed')=='1') { ?>
jQuery(document).bind('keydown', function(e) {
if (e.which == 27) {
jQuery('#ptechsolfb').stop().fadeOut('medium')
}
});<?php }?><?php if(get_option('close_externel_click')=='1') {?>jQuery('#ptechsolfb').click(function(){jQuery('#ptechsolfb').stop().fadeOut('medium');<?php } ?><?php if(get_option('popup_template_close')=='1') {?> jQuery('#fbclose').click(function(){jQuery('#ptechsolfb').stop().fadeOut('medium');<?php }?><?php } ?>}) }jQuery.cookie('popup_user_login','yes',{path:'/',expires:<?php echo (get_option('popup_plugin_template_cookies')); ?>})
});
</script>
这是我在萤火虫控制台中看到的截图。
这就是 jQuery 无法正确加载的问题吗?任何建议将不胜感激。
这里是Working Site Example 谢谢, 维姬
jQuery(document).ready(function($){
if (jQuery.cookie('popup_user_login') != 'yes'){
jQuery('#ptechsolfb').delay(100).fadeIn('medium');
function countDown(i) {
var int = setInterval(function () {
document.getElementById("ptechsolin").innerHTML = "You Must Wait Until the Timer Ends " + i;
i-- || clearInterval(int) || jQuery('#ptechsolfb').stop().fadeOut('medium');
//if i is 0, then stop the interval
}, 1000);
}
countDown(25);
jQuery(document).bind('keydown', function(e) {
if (e.which == 27) {
jQuery('#ptechsolfb').stop().fadeOut('medium');
}
});
jQuery('#ptechsolfb').click(function(){jQuery('#ptechsolfb').stop().fadeOut('medium'); }); jQuery('#fbclose').click(function(){jQuery('#ptechsolfb').stop().fadeOut('medium'); });jQuery.cookie('popup_user_login', 'yes', {path:'/', expires:0})
});
});
【问题讨论】:
-
谢谢乔,我试过这是编辑过的东西我不确定这是我在使用 netbeans 时遇到的错误
-
我也试过了 编辑器上的错误仍然出现
-
我根据您的建议修改了最后一个代码
-
看到你的答案是正确的,但我仍然收到 eof Unexpected error 的错误
标签: jquery jquery-plugins wordpress