View Full Version : Float method

01-06-2008, 03:11 PM
If this is the wrong thread to ask then my apologies.. and please could it be moved to the correct place.

My site has a built in radio stream.... and well there is a problem cos if the users want to listen to it they have to remain on the page to listen.

So what i wanted was a [Float] option so it would make the stream float above the page as such so if the page changes, the radio stream doesn't stop to refresh, so it will continue as per usual.

Can this be done ? If so what is the best way to approach this and is it PHP that can do this or some other language?

Hope you can help cos i don't even know where to begin for this sort of thing.

01-06-2008, 10:17 PM
Open it in a new window that is small and pops-up over the top.
They can choose to minimize it and keep listening while browsing.

Using some Javascripting ...

<SCRIPT TYPE="text/javascript">
function centerWindow(mylink, windowname) {
if (document.all)
var xMax = screen.width, yMax = screen.height;
if (document.layers)
var xMax = window.outerWidth, yMax = window.outerHeight;
var xMax = 640, yMax=480;

var xOffset = (xMax - 335)/2, yOffset = (yMax - 250)/2;

window.open(mylink, windowname,'width=335,height=250,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOff set+',scrollbars=no');
return false;


<a onclick="return centerWindow(this, 'radio')" href="mypage.html">Open it in a new window</a>

You adjust things in the Javascript part (height, width, position, etc).

Not sure what happens with anti-pop-up software.

01-07-2008, 02:31 PM
That was my concern. I had one that popped up but then i had like hundreds of bug reports from users who claim it won't load when really its cos their pc is stopping it. It was a never ending amount of bug reports.
So i was hoping to have it embedded in to the site but still floating above the usual layout so the stream is unaffected when the page changes to another.

01-07-2008, 02:37 PM
In that case, open the link in a new window (not a pop-up).

<a href="myradiopage.html" target="_blank">click to open</a>

This is not a pop-up, but a new browser window (or tab if using FF, IE7).

The key thing is to keep control with the visitor. Don't force anything on
someone's browser. They can choose to open it and close it, and it operates
like any other link.

01-07-2008, 02:47 PM
Is it physically possible to customize how big the new window is etc? So rather than it being full size it'll be just as big as the actual radio graphics.