From: Will Budic Date: Thu, 27 Feb 2020 06:42:36 +0000 (+1100) Subject: msg display positioning added. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=661e415ba2f4afff857c7a3730a5c9b8353e3bb8;p=LifeLog.git msg display positioning added. --- diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index dbf0c37..be1e19a 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -32,6 +32,7 @@ function onBodyLoad(toggle, tz, today, expires, rs_cur) { TIMEZONE = tz; TIME_STAMP = new Date(today); onBodyLoadGeneric(); + if (toggle) { this.toggle("#div_srh", false); } @@ -170,6 +171,16 @@ function onBodyLoad(toggle, tz, today, expires, rs_cur) { }}); } + jQuery.fn.dispPos = function () { + this.css("position","absolute"); + this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight())-320 ) + + $(window).scrollTop()) + "px"); + this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 6) - 100 + + $(window).scrollLeft()) + "px"); + this.css( "zIndex", 8 ); + return this; + } + $("#dropdown-standard a").click(function(e){ e.preventDefault(); @@ -244,9 +255,7 @@ function onBodyLoad(toggle, tz, today, expires, rs_cur) { setPageSessionTimer(expires); - display("Log page is ready!"); - } function encodeText(el){ @@ -700,12 +709,14 @@ function showAll() { // display(desc); // } + function display(desc, times){ var pnl = $("#cat_desc"); if(!times){ times = 1; } pnl.html(desc); + pnl.dispPos(true); pnl.show(); pnl.fadeOut(1000*times); }