Random Music Loader/refresh
Jul 15, 2002
This is a script that will load a page with a random background song, plus will refresh the page when the song finishes!
<script language="javascript">
// use this script freely
// var numsong stands for the number of songs given
var nummidi = 5
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*numsong
+ 1,10)
if (ran == (5))
{
song=("song source")
words=("song name")
time=("song time in seconds")
}
else if (ran == (4))
{
song=("song source")
words=("song name")
time=("song time in seconds")
}
else if (ran == (3))
{
song=("song source")
words=("song name")
time=("song time in seconds")
}
else if (ran == (2))
{
song=("song source")
words=("song name")
time=("song time in seconds")
}
else if (ran == (1))
{
song=("song source")
words=("song name")
time=("song time in seconds")
}
document.write('<meta http-equiv="refresh" content="' + time + ' URL=npmusic.html">')
document.write('<EMBED SRC= "' + song + '" CONTROLS=smallconsole HEIGHT=45 WIDTH=290 AUTOSTART=TRUE LOOP=FALSE VOLUME=100%>')
document.write('<br>You are listening to ' + words + ' ')
</SCRIPT>
This script was made for a small pop-up window to have nothing but the song file in it. Also, you use this script in the <body> of the file. (Yes, the meta tag works there) ...
View 7 Replies
ADVERTISEMENT
Oct 28, 2011
Looking for a way to have background music play automatically when my site loads, with the music being randomly picked from a list of several songs.. So each time the page loads, a different song should play.. Can be JavaScript or Flash, whichever way works the best.
View 1 Replies
View Related
Jan 7, 2004
Code:
I've tried looking for a script that will do the same but I keep coming across javascripts that will change just one image randomly or change multiple images randomly but the images aren't related.
I also have seen PHP scripts with full-fledged features and an admin panel where I can create ad farms to accomplish my goal but I think that's overkill.
Does anyone know where I can find this javascript? FYI, I am weak at writing javascript myself so that's why I'm looking for a cut-and-paste script.
View 5 Replies
View Related
Apr 14, 2007
Does anyone know of a scipt that will rotate random div layers on page
refresh? I have a primary content area front and center on my site
homepage, and I'd like to rotate various chunks of html (in div
layers) each time a user reloads the page. Right now I'm resorting to
a random image rotation (those scripts are a dime a dozen) on refresh,
but it's far from ideal for what I'm trying to accomplish.
View 10 Replies
View Related
Jan 1, 2009
I have a div on my page with an id of "quote". It contains a quotation and an image of the person who made it, like so:
<div id="quote">
<blockquote>Quotation blah blah blah<p>Joe Bloggs</p></blockquote>
<img src="joe_bloggs.jpg" alt="Joe Bloggs">
</div>
I'd like to make the quote dynamic so that a different quote and accompanying image is shown at random when the page is refreshed.
View 10 Replies
View Related
Sep 27, 2010
I wanted help for a JavaScript code. You might think I'm lazy for not writing it myself, but the truth is I am not a JavaScript coder. I just have a really simple website and I am trying to do something for which I know JS is required but I don't know how to do it. I've also searched around but couldn't find the appropriate code.
What I want to do is to make an html page load a different background image every time it refreshes.I will have a list of background images and I want to be able to add in this list, without having to change anything else in the codes after I do this (I think this is made by making an array of images and by putting .length somewhere in the codes, but I don't know exactly how I should do this).I already know how to do an external file (.js) and link to it from my .html page.Now I want the code to put in the .js file, and the code to put in the <body> of my .html file.
View 4 Replies
View Related
Nov 12, 2010
I have 3 divs. I want distribution them random (when refresh the windows, three divs' position will be changed)
I think Math random() can solve this problem, but how to do that? [code]....
View 2 Replies
View Related
May 16, 2010
I have a web site which main page is index2.html I need a script that when I refresh the page it takes me to index3.html or index#.html in a random fashion. the list of index numbers is 10 so far.
index3
index4
index5
etc etc
View 2 Replies
View Related
Nov 16, 2006
I have a PHP page that talks to a MySQL page, i want to put in a "loading"
message. I have tied to use a layer and using a showlayer at the top of the page and
hide at the bottom, but it does not work, it still waits for the PHP to run. I know it can be done, as i have seen it, how do they do that?
View 3 Replies
View Related
Apr 27, 2006
Is there a way of getting javascript to load or reload on a mac?
At the moment I use this function Code:
function addScript(js) {
mybody=document.getElementsByTagName("body")[0];
newScript = document.createElement("SCRIPT");
mybody.appendChild(newScript);
newScript.setAttribute("type","text/javascript");
newScript.setAttribute("src",js);
}
but it doesn't seem to work on the mac.
I know I have the option of working with xml, but why would I want to create another output when my script already has a html output.
I use it like this (php)
Code:
$html="";
$html.="<h1>livescript</h1><p><a href=http://www.sitepoint.com title="sitepoint">Sitepoint</a>";
if($_GET["live"]=="on"){
header("ContentType: application/x-javascript");
echo "document.getElementsByTagName("body")[0].innerHTML="".preg_replace("/"/","'",$html).""";
} else echo $html;
works nicely, but not on a mac.
View 2 Replies
View Related
Apr 17, 2011
http:[url].....If you're on fast internet, you might not even see it, but I don't know how they do two things upon entrance.
1.) Allow the content to load (and function as a preloader)
2.) Get everything to fade in after loader completes. Is it just a div overlapping everything where opacity turns from 1 to 0 or what?
I know this loader must be javascript, but this is all I can find when viewing the source, so I don't know if there is php involved but I'm guessing there is.
<div id="csd3-jscheck">
<h1>Color Scheme Designer 3</h1>
<div id="csd3-load">[code].....
View 3 Replies
View Related
May 12, 2011
I have a small function that replaces an image with that of a clicked thumbnail (and updates some text). Is it possible to display a loader whilst the new image is being downloaded?code...
View 4 Replies
View Related
Feb 6, 2010
Im using below code to load the page when im selecting option in dropdownbox. Now, I need to add loader img before load page.
[Code]...
View 3 Replies
View Related
Apr 13, 2011
Can anyone teach me on how to use this script? (im not a programmer )
i wish to use this but the images are in each div code...
View 1 Replies
View Related
Aug 19, 2009
I'm creating a site using AJAX and I would like for an ajax loader to appear in between the page loadings.
$("#menu ul li").click(function(event) {
$("#ajaxLoader").show(function(){
alert('hello');
});
setTimeout("jQuery.fn.test("about");", 3000);
});});
jQuery.fn.test = function(page) {
$("#content").load(page + ".html");
$("#ajaxLoader").hide(function(){
alert('good bye');
});};
This works perfectly the first time - the ajax loader appears for about three seconds before disappearing and instead the page is displayed. But the second, third, fourth ... time, the ajax loader never shows up.
View 2 Replies
View Related
Apr 27, 2010
I want to make a gallery with image loader. When image placed in JavaScript Image object finishes loading, the script includes it into HTML code and performs jQuery fadeIn effect on it.
The '.complete' property of the Java Script 'Image' object is perfect for this purpose(recognizing when image has finished loading) but the only problem is that Mozilla Firefox doesn't recognize this property and in this browser it's always true(always loaded) even if it's not. The script works perfectly in other browsers.
Does someone of you know what is the other way of recognizing whether the image finished loading or not?
View 8 Replies
View Related
Jul 20, 2005
In the background should play a midi file. That's not the problem but when
the midi file is played another one should start automatically. During
playing the first midi file the second should be downloaded and so on.
What I don't know is when the midi file is played and when I should start
the next midi file.
View 1 Replies
View Related
Apr 21, 2011
Does anyone know how to add an ajax loader to the remember the milk validation example? So that while the backend is busy, it shows the gif, when it's finished, it hides the gif...
View 5 Replies
View Related
Apr 2, 2011
I want to start coding using the YUI provided by yahoo, but do not understand how to set up the yui.loader script that pulls in the rest for me. What this script does is pull in all dependencies and install them. Just like using the installer in linux. But there does not seem to be any howtos for beginners. I have never used jaascript before, And this is suppsed to be a cut & paste way of getting started but I have been doing that most of the day and reading about it but I still obvoisly do not understand or missing somthing.
[Code]....
View 14 Replies
View Related
Nov 5, 2000
I'm hoping to find a way to load a music file that will continue to play when moving from page to page without interuption, only ending when the site has been left. I've only seen where the music resets every new page.
View 3 Replies
View Related
Jan 29, 2011
I'm working on a php/jQuery application, I want to display a loading image automatically every ajax request, without writing code for every ajax request. Is there anyway to do this.
View 1 Replies
View Related
Oct 1, 2009
I am having a little problem trying to show a loader (An animated GIF) while some request to a database happens. I have a page where the user selects a YEAR and when they select it with AJAX I perform a request to a database to get all the values for that specific year.
The problem is that there is a lot of information (4000+ records) that I need to query and show in a table (Actually I didn't use a table I use DIVs that look like a table), and when the user selects the year the webpage freezes for about 5 seconds and then it loads all of the data.
Is there a way to sort of show an image loader gif while the data is being gotten? I tried putting the loader image in the DIV container while no year is selected and then once the request is done, I substitute the DIV container's contents (The image loader) for the data from the database.
[Code]...
View 1 Replies
View Related
Jun 14, 2011
how to do a custom lazy load ???You know for instance... lets say I got 500,000 images to load on a page... it's inside a dive... well I want to load the images when it's needed.So not all 500,000 images will load all at once. I want like 10 to load at a time.. this will make the div scrollable.so when the user scrolls down to the 8th image it will load 10 more images and so on.
how to make their own function like this?how do you detect if the user scrolled to the 8th image? I am pretty sure I can use a function.... that will send variables to a php script that will use the mysql limit. The javascript would send a value which is where to start loading from the 10th image in the database.. meaning start grabbing the images from the 11th image onward for a max of 10 total images to display.
View 1 Replies
View Related
Jun 22, 2010
this site [URL] plays music when you are there.
how do they do it?
View 1 Replies
View Related
Aug 17, 2011
I have got a client who wants to have music playing on his site, the music player should be opened in a pop-up window. The website is standard html / css / js website, without any flash or such things.
Problem which I have:
I open the pop up window with music player when visitor visits Home Page, when visitor comes to other page without visiting home page I need to check if pop up window is opened or not and if it is not opened I open a pop up window and start to play music, how to achieve it?
View 1 Replies
View Related
Dec 26, 2004
1) Uses the <body onload> function but does not get blocked by pop up blockers and firefox. (This site, sitepoint, has a pop up that is not blocked)
2) Stays open and does not reload when someone clicks on the trigger link again. If someone click it should just bring back the same window.
3) The window always stays in front of other windows unless minimised.
View 2 Replies
View Related