我有一个弹出的登录表单(onclick),但是当我单击站点上的任何页面时,它会闪烁一秒钟。它是使用 wordpress 的这个插件生成的http://wordpress.org/extend/plugins/flexible-frontend-login/
要重新创建,只需加载站点并单击导航栏中的日历链接..您将看到登录表单闪烁..我在控制台中看不到任何内容..
相关的Javascript(我认为..取自控制台/资源):
jQuery(document).ready(function($) {
// $() will work as an alias for jQuery() inside of this function
// Add an empty container for overlay
$(document).ready( function($) {
$('html').prepend('<div id="ffl-mask"></div><!-- added by Flexible Frontend Login Plugin. Needed for overlay. -->');
} );
$(document).ready(function() {
//select all the a tag with name equal to ffl-modal
$('a[name=ffl-modal]').click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr('href');
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$('#ffl-mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#ffl-mask').fadeIn(600);
$('#ffl-mask').fadeTo("fast",0.8);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(1000);
});
//if close button is clicked
$('.ffl-window .ffl-close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#ffl-mask, .ffl-window').hide();
});
//if mask is clicked
$('#ffl-mask').click(function () {
$(this).hide();
$('.ffl-window').hide();
});
});
// calculate mask when user resizes window
$(document).ready(function () {
$(window).resize(function () {
var box = $('#ffl-boxes .ffl-window');
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$('#ffl-mask').css({'width':maskWidth,'height':maskHeight});
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
box.css('top', winH/2 - box.height()/2);
box.css('left', winW/2 - box.width()/2);
});
});
$(document).ready(function() {
// find all instances of flexible-frontend-login to append individual links
$('a[name=ffl-popup]').each(function(){
// get the tags from link
var id = $(this).attr('href');
// set linked div to hidden
$(id).hide();
});
// select a tags with name equal to ffl-popup
$('a[name=ffl-popup]').click(function(e) {
// cancel link behavior
e.preventDefault();
// get the tags from link
var id = $(this).attr('href');
// Set visibility
$(id).css('display', 'block');
});
//if close button is clicked
$('.ffl-close-popup-link').click(function(e) {
//Cancel the link behavior
e.preventDefault();
// get parent id
var id = $(this).parents('div:eq(0)').attr('id');
// and hide it
$('#'+id).hide();
});
});
});