Jump to content
xisto Community
Sign in to follow this  
mandla

Script That Refreshs Off Te Page After Every Scroll can anyone code this for us

Recommended Posts

I am looking for a two function script. So far I have managed to work out the first bit but then maybe someone out there has a slightly better way around this whole thing and may have worked an easier way of achieveing this before.I am designing a radio station website and would like to be able to have a scrolling marquee that displays the current song playing. I have managed to work this out and successful managed to display the cureent song from the shoutcast page. What I need then is to have a little section on the site where there is a srolling marquee and everytime the text finished scrolling across it refreshed of screen. Basically once its finished scrolling and the text s of creen i want it to check if the song playing has changed and if the song has changed when it next scrolls to display the new cureent song. I know this may sound all technicall but maybe if i say I was a script to refresh after every scroll. I can then replace the the text scrolling with a dynamic variable. Its not getting the data to display i have trouble with. Its getting the screen to refresh the data without refreshing the whole screen. I used meta refresh before and i refreshed every 3 minutes but the was an inconvinience because i think in safari the browser kept returning to the top of the page when refreshed. This caused readability poblems as the pae would suddenlt move back to the top without my saying the page should so looking at iit froma user who has no idea that the page refreshes every 3 minutes just to update the song i thought thats gonna put people off. With IE it would just blink which was fine when i knew that this was a page refresh to update songs but what about someoen who easily freks cause they think its a virus flickering ther screen? This OpTION might confuse those who have never worked with IFRAMES SO ID SKIP THIS PARAGRAPH IF I DONT KNOW HOW TO WORK WITH IFRAMS: The other way was to use a iframe which would display just the bit of another page with a refresh meta tag every 3 minutes and that page can do all the flickering and scrolling to the top it wants because thered only be one line of text displayed on it then this would mean it would work and it probably will but I'd just think its a bit tacky. especially if they have a broswer that dont support iframes.Anyway I know that someone out there probably has the know how to write a java script or asp or what ever language to achieve this in a simpler manner and If anyone knows how to do this please code it for me and help us out will you.

Share this post


Link to post
Share on other sites

I'm not quite sure I understand-You have a scrolling marquee on your website and it scrolls by itself? And refresh the page when it reaches the end by itself?In this case, the speed of scroll and amount of text should already be defined. Simply put it through an algorithm that returns to you the total time it takes to scroll, and then have it refresh at that interval.Or, do you mean the user is scrolling it?Well, in either case, what you COULD do is to set a timeout function when the body loads, and have it refresh at the given interval, which you would define.This might be slightly troublesome, however, as you would need to put in the length of every song. Alternatively, you could just set a default rate in which it refreshes.Doing this would require PHP and JavaScript. I can help you write a script if you need to. ;)And, of course, the absolute best way to do this in any situation would be to use AJAX, which would completely render refreshing obsolete, which, again, I can help you write the script for if you need help.

Edited by Rigaudon (see edit history)

Share this post


Link to post
Share on other sites

How about placing an anchor at the location where you the page to be after it refresh. At your refresh script, instead of the just putting the page, try putting the anchor in , ie your-page.html#location

Share this post


Link to post
Share on other sites

How about placing an anchor at the location where you the page to be after it refresh. At your refresh script, instead of the just putting the page, try putting the anchor in , ie your-page.html#location

what exactly would this function do. would it just refresh the bit of the page that is after the marker id location.
also I eventually used a iframe or framset cant remeber exactly but what I did was write a new html /php page with margins on top and left set to zero. then had this page have the meta refres every 60 seconds seeing as songs play about 1 minute to about 6 minutes so I assumed refresh every minut will be fine.

I then used a iframe with no scrolling and no border and obvious witht the width set to whet I requred for the set aside space on the orignal desing, so the page displays as if part of the original index file and every few minutes it just flickers and updates the new info. yopu hardly notice it as you are browsing especially when it change sdue to a new song playing at it looks like it just updated the info. All I neednow is to be able to set it up so that a listener can click a Buy song button and is able to pay for the song via paypal and download it using a ddynamic link. You knwo the fake links thats are created when you purchase a MP3 and this creates a unique temporary folder and you can download the song with in 3 hours and it lets you downloa dthe song three time and and exppires due to the time out or the max download is reached. How do I set up a diectory on my CPanel which cant be accessed.

anyone know?


Thansk guys and girls for all your help. These Forums are so helpfull

Share this post


Link to post
Share on other sites

I insist that you use AJAX for this, but if you don't know AJAX, then I guess you can stick with the frame.You can find the paypal button from paypal.com. They also give you the code for it.To make a folder restricted, go to file manager in your cpanel, select the folder, and choose "change permissions".To make a limit on the amount of times one can download, you should use a database to store the amount of times a file has been downloaded and redirect the user if download limit has been reached (why bother? Software can be copied anyways).By the way, if you play the song on your website, then the person can view the source and find where the song is located and ultimately get it for free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.