Simulate the dropdown alert bar & noise of "flash update required"
Hi,
I want to recreate the effect of the drop-down bar that appears at the top of your browser when prompted to download an updated version of flash. Its for a proprietory plugin, but can't seem to get anywhere with it... Anyone have any ideas?
I want to recreate the effect of the drop-down bar that appears at the top of your browser when prompted to download an updated version of flash. Its for a proprietory plugin, but can't seem to get anywhere with it... Anyone have any ideas?
Here ya go....
Code:
/**
* creates an info bar at the top of the browser
**/
function infoBar(text) {
var b = document.body;
var d = document.createElement('div');
var p = viewPortInfo();
d.style.width = String(p.width + 'px');
d.style.height = '16px';
d.style.color = '#000000';
d.style.backgroundColor = '#ffffe1';
d.style.border = '1px solid #666666';
d.style.position = 'absolute';
d.style.top = '0px';
d.style.left = '0px';
d.style.padding = '6px';
d.innerHTML = text;
b.appendChild(d);
}
/***
* get client browser window size and position
* returns a number (no 'px' suffix).
**/
function viewPortInfo () {
if (document.documentElement) {
return {
height : Math.round(document.documentElement.clientHeight),
width : Math.round(document.documentElement.clientWidth),
top : Math.round(document.documentElement.scrollTop),
left : Math.round(document.documentElement.scrollLeft)
}
} else {
return false;
}
};
__________________ "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov
/**
* creates an info bar at the top of the browser
**/
function infoBar(text) {
var b = document.body;
var d = document.createElement('div');
var p = viewPortInfo();
d.style.width = String(p.width + 'px');
d.style.height = '16px';
d.style.color = '#000000';
d.style.backgroundColor = '#ffffe1';
d.style.border = '1px solid #666666';
d.style.position = 'absolute';
d.style.top = '0px';
d.style.left = '0px';
d.style.padding = '6px';
d.innerHTML = text;
b.appendChild(d);
}
/***
* get client browser window size and position
* returns a number (no 'px' suffix).
**/
function viewPortInfo () {
if (document.documentElement) {
return {
height : Math.round(document.documentElement.clientHeight),
width : Math.round(document.documentElement.clientWidth),
top : Math.round(document.documentElement.scrollTop),
left : Math.round(document.documentElement.scrollLeft)
}
} else {
return false;
}
};
Hi sorry about the delay in responding. I tried using this within script tags, but literraly nothing happens??