HTML - Script That Will Choose A Random Div To Display?
Hello everyone! First post on the forum, and wow, I spelled my username wrong
Anyway, I am working on a new project, a rather adventurous and something out of my comfort zone one at that The website I am working on can be seen currently at it's development address - http://test.tinyentertainment.biz (Please note that most links, buttons, etc. do not work or are dead as it is of course, a development in it's early stages.) Anyway, my question is, is there a script or something else that would allow me to enter in a number of divs', and every time the page is reloaded, it will choose a random, or systematic, one to display? What I want to do, is if you notice on the home page of the website linked to above, below the large text under the flash banner, there is a quote- " "You're so afraid of taking chances, how you gonna reach the top?" -Greyson M. Chance" " I would like to have a number of different quotes to be displayed there when the page is reloaded. The current code is- Code: <div class="row"> <h3 class="center">We are a <span>fan community</span> dedicated to supporting <span>Greyson Chance</span> and his career.<b /> Don't forget to visit the <span><a href="http://www.thegreysonchanceforum.com" target="_blank" title="Visit The Forum - The Greyson Chance Forum" onMouseOver="window.status='Visit The Forum - The Greyson Chance Forum'; return true" onMouseOut="window.status=' '">forum</a></span> to chat with other fans.</h3> <p class="center"><em>"You're so afraid of taking <span>chances</span>, how you gonna reach the top?" -Greyson M. Chance</em></p> Thank you! Similar TutorialsOn my main page www.virtualhunterston.eu.org I have 3 images under the featured image section. I can quite easily find a script that will allow me to randomize the image, but I cannot find a script that will allow the image to be random and also have words below. Example. On the link above I have Castle Gate as a featured Image. How can I have it as random image and it changes the name below it as well? say i was to have Avenue Gate I would want the image for that gate but also to say Avenue gate below it. Hope that made sense?, and that anyone can advise. Hi I'm having trouble figuring out how to import a specific set of data from XML using xpath. I haven't been able to get my head around the examples I have been playing with. Here's an example of my XML: <X> <S> <A>Blah</A> <T>Blah</T> </S> <S> <A>Blah</A> <T>Blah</T> </S> <1a> <S> <A>Blah</A> <T>Blah</T> </S> <S> <A>Blah</A> <T>Blah</T> </S> </1a> <S> <A>Blah</A> <T>Blah</T> </S> </X> and php to import it: $xml = simplexml_load_file('test2.xml'); $result = $xml->xpath('S/A'); print_r($result); The above prints out the blah's in all the <A></A>'s. How do I get only the blah's in all the <A></A>'s that are between the <1a></1a> nodes? Various combinations I try give empty arrays. Thanks for your help. Shaun I want the visitor to my website to be able to choose 2 live webcam streams from a text list of say 20 different streams, I have the code for each stream, what I would like is the 2 chosen streams to display on the same page side by side as i am not very good in php and oither scripting. I browse through this forum and found the easier way to sent a form result via email is to add a mailto in form action <form action="mailto:acb@def.com"> Now my question is, can i do a droplist and put a several email for user to choose. after choose. then my action will send the email out according to what the user choose... Hello all, I'm try to use a form to choose what webpage is displayed in an iframe on the same page. What I have so far is not working: <form name="list" action="" method="get" target="repIframe" style="margin:0px;padding:0px"> <select name="zone"> <option value="./testadvisory.php?warnzone=UTZ019&warncounty=UTC053">St. George</option> <option value="./testadvisory.php?warnzone=UTZ013&warncounty=UTC043">Cedar City</option> </select> </form> <iframe name="repIframe" src="blank.html"></iframe> Could someone offer a suggestion ir procedure to allow the use of a form to choose the content of the iframe? Thanks, Randy I have a webpage at http://atlas.walagata.com/w/osmose/moosecorps/. It's a PHP page that sticks different code in the body depending on the page. The main page's newsbox does not appear correctly in IE6, but I can't figure out why - every cell but the one that should be stretched has a cell width defined. Any help would be appreciated. EDIT: Ugh, the Books page isn't working either. Again, help would be nice. I would like to know how to create a mini form of two pull down boxes so that when the two selections have been made and submitted it returns back a designated page or picture. For example I want to build a simple method to show routes of an office building. Pulldown box 1 would be the office number you want to start from, and pulldown box two would be the office you want to get to. when you click submit it would pull up either a page or picture which contains the corrrect floor plan and route. I feel like this should not be too hard as I don't need anything very flashy. I just don't know how to start it. If anyone knows of something open source already created to do this I would be open to that too. Thanks in advance for any assistence you can give. please help choose a nice background color theme for my site... I'm not savy with html...I'm trying to find the code so I can change this "plain jane" background color of my "template made site". Can I get some opinions on a color theme and ALSO where I would insert the color codes. Not looking for a "in your face" attack..just anything better than the blah brown/tan colors! TIA Where would i be able to learn how to make a script that goes like this: The person puts a script in the message box (eg. [.b]hello[/b] ), presses the button and on the main page it displays the code they put in. (hello) Thanks Hi guyz, i have a query Mouse over the datagrid cell display tooltip or panel to display information but only using HTML and CSS not using javascript. can anyone help me. because im gonna use it on htmleditor on c# desktop application thax before Hey there! Is it possible to have a random GIF file loaded each time you open the site? For example if you open the page now, an animated GIF will load to advertise x and when you go to the same page later, an ad will load to advertise y. Thanks in advance! I Say I have 10+ 468x60 banners I was wondering if there is anyway of having them show up randomly in one spot when you refresh the page. For example here is an ad I'm using: <script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-2762512?target=_blank&mouseover=N"></script> I know there is a way to random images but how do you randomize scripts? I have this code below, and i would like it to randomly place 2 X's in any of the boxes, and each time i refresh the page the X's could end up in any of them, any idea how to do it? Thanks Dr Ben HTML Code: <html> <head><title></title></head> <body> <form name="placeships" action="board.php" method="post"> <table> <tr> <td align="center" bgcolor="black"><input type="text" id="1" class="hide" name="1" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="2" class="hide" name="2" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="3" class="hide" name="3" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="4" class="hide" name="4" value="" size="2"> </td> </tr> <tr> </tr> <input value="submit" name="submit" type="submit"> </form> </body> </html> Hello everyone. Sorry for appearing to be another person to register with "vitally important question" and then probably never be seen again, but I think I'll be using this site to learn as much as I can about HTML. Anyway, my question is about HTML, but not for a website. It's for an iPhone widget. I don't want to advertise for any other forums or anything, but there is currently a tweak in development that allows for windows phone 7 live tiles on an iPhone. They use HTML code and as you can tell, I'm not a coder. There is a slideshow widget available that displays a random picture from a set location. I'm very new to HTML, but I have figured out quite a bit by changing a value and having a look at what it did. There is one thing that has me completely stumped though and this is what I would like to know. In the following code, it has the [Math.floor(math.random() bit. I've tried to add a 1 in the brackets, I've tried changin the random to no and false, I've tried just removing the line and I still can't get it. <html> <head> <meta name="viewport" content="width=238, user-scalable=no" /> <script> window.onload = onLoad; var array = "101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124".sp lit("|"); function onLoad(){ document.getElementById("show").src = array[Math.floor(Math.random()*array.length)] + ".png"; setTimeout(onLoad,1*200); } </script> </head> <body> <img src = "overlay.png" style = "position:absolute;top:0px;left:0px;z-index:1;"/> <img id ="show" style="position:absolute;top:-0px;left:0px;width:238px" /> </body> </html> What I want is for it to cycle through all the images in order. Any help would be greatly appreciated. THanks. Hi there, I have created a site that can be viewed at www.prestigeinteractive.com/legacy2 On this site I have utilized a basic two column design with both a header and a footer. You may need to look at the first page to know what i am talking about. Upon creating the site I wanted to make the athletes on the page extend beyond the borders of the site's wrapper. In order to do that and maintain reasonable filesizes, I opted to splice the images. I used a jpeg for the large part within the wrapper, and used a png in a absolute positioned div for the parts that are to extend beyond the site's wrapper/container (needed a transparent image to display the border and site's background properly). The friend I am making the site for asked if I could set it up so that there can be a number of images that randomly load when a user enters the home page. I am not sure it that is possible using the format I've implemented (2 images properly aligned). Can this be done? I've done it before with single images within a div tag, but not two that need specific coordinates to appear aligned correctly. If "yes this can be done", could someone kindly point me in the right direction to find a tutorial on this. If not, I'd appreciate knowing this as well, as I'll need to come up with an alternative plan. Thank you for your time, G on the mainpage of my site, i have a enter button, however I have 4 different sites. I want when you click enter, it brings you to 1 of the 4 at random each time... how would i go about that? thanksss. its much appreciated to whoever trys or can help. I am an Admin for a PC gaming clan ( |ESF| ), and we have several game servers. Our goal is to have a random "server of the day" widget on the main page of the site. Here is what we need it to do: > Show the same server for all visitors to the page > Show the same server for a 24 hour period, say from 12am - 11:59pm > Have the code editable in case we change/add/remove a server I have some experience in Vb6 and Vb.Net, but not much HTML. I would assume the code would be something similar to: Dim SOTD As New String (Server of the Day) "Server List" Dim s1 As New String (Server 1) Dim s2 As New String (Server 2) Dim s3 As New String (Server 3) If TimeOfDay Is 12:00am Then Show SOTD(Random Server from List) Until TimeOfDay Is 11:59pm End If I know that isn't close to HTML, but it should help get the overall point across. Any help to get us closer to this goal is MUCH appreciated. If I wasn't specific enough with the above information, please let me know what else you need to know. It's very late and I'm super tired. Thank you in advance. Hello everyone! I have this client who has a lot of resellers, and all of them are on a list in his website, so that when customers look for someone to buy from, they can choose through his site. However, he is afraid that if the list is static, no one will bother to look beyond the first 2 or 3 names, and the ones in the bottom of the list will never be contacted. So, I need to create a method to display the resellers list in such a way that everytime one accesses the list, the order is changed at random, but always displaying all the names. The HTML code the names are arranged right now is a simple table with one reseller per TR tag. I don't work with MySQL, so the solution should be something else... PHP or Java preferred. Thanks in advance! Maybe someone here can shed some light on this for me. I am trying to create a site which displays 12 random questions from a pool of a few hundred. A visitor will come to the site, answer the questions and see the results, much like a poll but they will be randomly generated. I am lost as to where to start on this. I tried a poll type approach but that was not the answer. Those were fixed questions and the polls were powered by other sites. Anyone have ideas or tips on how I can start on this? Hello, I am trying to design a very simple HTML game, but there are some fundamental questions which I need to resolve before I know where I need to start. I was wondering if its possible to use just HTML (running on an old computer (pentium 3 or 4) on linux) to execute commands like, loading up a random page, loading a page after a count down timer is up, loading a page when any key is pressed and being able to turn these commands on and off according to eachother.. You might be able to tell from this that I am not very experienced at all with this sort of thing.. an example: A web page is showing, the user presses any key, a random page is loaded, a countdown timer starts, the user either presses a specific key or the time runs out, the result is a new web page loading depending on the amount of time that has expired on the countdown timer, a new coundown timer starts, when it runs out the original start webpage is loaded and the loop can go on. I would really appreciate any help on this. |