2013-03-05 3 views
-1

나는 (onclick) 팝업 로그인 폼을 가지고 있지만 사이트의 모든 페이지를 클릭하면 초 동안 깜박입니다. 그것은 단순히 다시 사이트를로드하고 메뉴 바에서 일정 링크를 클릭 워드 프레스 http://wordpress.org/extend/plugins/flexible-frontend-login/자바 스크립트 오류 .. 왜 로그인 양식이 잠깐 동안 깜박입니까?

http://oilfieldconference.com

이 플러그인을 사용하여 생성됩니다 .. 당신은 내가 아무것도 참조하지 말아 .. 로그인 폼 플래시를 볼 수 있습니다 콘솔 ..

enter image description here

관련 자바 스크립트 (내가 생각하는 .. 콘솔에서 촬영/자원) :

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(); 
     });  

});  

}); 
+0

자세한 정보가 필요합니다. 귀하의 모듈/확장 기능/당신이 사용하고있는 CMS가 무엇을 생성합니까? 이것은 우리가 접근 할 수없는 정보입니다. – Daedalus

+0

또한, 그것은 나를 위해 깜박이지 않습니다. – Daedalus

+0

해당 wordpress 및 http://wordpress.org/extend/plugins/flexible-frontend-login/ – js111

답변

1

나는 당신을위한 해결책이 있다고 생각하지만, 당신이 사용하고있는 플러그인의 클래스 파일들을 편집하는 것을 포함합니다. 나는 JS를 보았다. 그것은 문제가되지 않습니다 .. 문제는 무엇입니까 문제의 div는 js가 그것을 숨기기 전에 페이지에서 생성되고 있습니다. 이를 수정하려면 다음을 수행하십시오.

$html .= "<div id='ffl-popup-content-$unique' class='ffl-popup-content ffl-{$this->horizontal_position} ffl-{$this->vertical_position}'>"; 

를 교체하거나 :이해야하는 flexible-frontend-login\includes\classes\class.FrontendLogin.php

이동하여 라인 49 찾을 : 나는 워드 프레스와 내 컴퓨터에 설치 문제의 플러그인이 없기 때문에이 안된합니다 이렇게 편집하십시오. 하나는 정말 작동합니다

$html .= "<div id='ffl-popup-content-$unique' class='ffl-popup-content ffl-{$this->horizontal_position} ffl-{$this->vertical_position}' style='display: none;'>"; 

이 편집은 JS 이후에 숨겨진 대신, 세대에서 숨길 수 문제의 사업부가 발생합니다.

+0

굉장! 그게 효과가 있었어! 정말 고마워! – js111

+0

@ js111 환영합니다. – Daedalus

1

자바 스크립트 나 다른 것을 게시하지 않았기 때문에 내 최고의 추측은 자바 스크립트에서 디스플레이 없음을 만들고 페이지로드 이후까지 실행되지 않는다는 것입니다. 어쩌면 귀하의 CSS에 가서 그것을 표시하고 onclick 표시 : 블록?

관련 문제