Jump to content

popup message


robert.access

Recommended Posts

Hi all! I have the following script:

 

var persistclose=1
var startX=3
var startY=0
var verticalpos="fromtop"
function iecompattest()
{return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function get_cookie(Name)
{var search=Name+"="
var returnvalue="";if(document.cookie.length>0)
{offset=document.cookie.indexOf(search)
if(offset!=-1)
{offset+=search.length
end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;returnvalue=unescape(document.cookie.substring(offset,end))}}
return returnvalue;}
function closebar()
{if(persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"}
function staticbar()
{barheight=document.getElementById("topbar").offsetHeight
var ns=(navigator.appName.indexOf("Netscape")!=-1)||window.opera;var d=document;function ml(id)
{var el=d.getElementById(id);if(!persistclose||persistclose&&get_cookie("remainclosed")=="")
el.style.visibility="visible"
if(d.layers)el.style=el;el.sP=function(x,y){this.style.right=x+"px";this.style.top=y+"px";};el.x=startX;if(verticalpos=="fromtop")
el.y=startY;else
{el.y=ns?pageYOffset+innerHeight:iecompattest().scrollTop+iecompattest().clientHeight;el.y-=startY;}
return el;}
window.stayTopLeft=function()
{if(verticalpos=="fromtop")
{var pY=ns?pageYOffset:iecompattest().scrollTop;ftlObj.y+=(pY+startY-ftlObj.y)/8;}
else
{var pY=ns?pageYOffset+innerHeight-barheight:iecompattest().scrollTop+iecompattest().clientHeight-barheight;ftlObj.y+=(pY-startY-ftlObj.y)/8;}
ftlObj.sP(ftlObj.x,ftlObj.y);setTimeout("stayTopLeft()",10);}
ftlObj=ml("topbar");stayTopLeft();}
if(window.addEventListener)
window.addEventListener("load",staticbar,false)
else if(window.attachEvent)
window.attachEvent("onload",staticbar)
else if(document.getElementById)
window.onload=staticbar

 

This script make a popup and I have modified css to look like an information bar that resize  on top. The problem is that the bar it's comming from top in a sec and when i move the page down and after  I move fast up the bar is "coming" to top.

 

 

I want to be fixed on top like internet infobar and to stay on top of othe items and in top of the webpage when I move page up and down.

 

 

Thanks  alot in advance for any help and suggestions!

Link to comment
Share on other sites

The problem is that the bar it's comming from top in a sec and when i move the page down and after  I move fast up the bar is "coming" to top.

Apologies if English is not your first language, but I couldn't understand a word of that.

 

I want to be fixed on top like internet infobar and to stay on top of othe items and in top of the webpage when I move page up and down.

Sounds like you're wanting the work done for you? Maybe you should be posting this on the freelance board.

Link to comment
Share on other sites

the bar it's appear from top and it's not fixed on top, I mean it's sliding down in a second. It's not fixed (what I want).

 

and I just want an opinion or a  simple code, mabe an ideea to change

 

if(verticalpos=="fromtop")

 

I dont think that it's so hard, but I really dont know java... :(

 

MrAdam, thanks for the freelance suggestion...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.