Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Float method

  1. #1
    New Coder
    Join Date
    Dec 2007
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Float method

    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.
    Last edited by SirChick; 01-06-2008 at 03:31 PM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,547
    Thanks
    8
    Thanked 1,094 Times in 1,085 Posts
    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 ...

    Code:
    </head>
    <SCRIPT TYPE="text/javascript">
    <!--
    function centerWindow(mylink, windowname) {
        if (document.all)
            var xMax = screen.width, yMax = screen.height;
        else
            if (document.layers)
                var xMax = window.outerWidth, yMax = window.outerHeight;
            else
                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='+xOffset+',scrollbars=no');
    return false;
    }
    
    //-->
    </SCRIPT>
    <body>
    
    .
    .
    .
    <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.

  • #3
    New Coder
    Join Date
    Dec 2007
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,547
    Thanks
    8
    Thanked 1,094 Times in 1,085 Posts
    In that case, open the link in a new window (not a pop-up).

    Like:
    <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.

  • #5
    New Coder
    Join Date
    Dec 2007
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •