jquery - Couldn't show messages in the center using center() function -


i calling flash messages through function:

function check_notice(visible_for) {   notice = $('.notice').text(); $('#block').show();     $('.notice_container').center().show().delay(visible_for).animate({       'opacity' : '0'     }, 2000, function() {       $('.notice_container').css({'opacity':'1', 'display':'none'});       $('.notice').empty();       $('#block').hide();     }); }  $.fn.center = function () {     this.css("position","absolute");     this.css("top", (($(window).height() - this.outerheight()) / 2) + $(window).scrolltop() + "px");     this.css("left", (($(window).width() - this.outerwidth()) / 2) + $(window).scrollleft() + "px");      return this; } 

.center() meant messages displayed in center. when use, there no message displaying , when remove center(), messages shown @ top. please me.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -