|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Random quote alignment
Okay, if you go here, you'll see that in the Wise Words pane, there is a quote, which is neatly aligned with the rest of the panes.
Now this quote basically stays the same each time you view the page. I wanted different quotes to show up every time. So I got this: Code:
<SCRIPT> /* Script obtained from Wsabstract.com For this script and more Visit Java-Scripts.net or Wsabstract.com */ quote0= "Life is like a box of chocolates."; quote1= "Java-Scripts.net is like a box of coco pops. "; quote2= "I have no idea what I am saying. "; var ran_unrounded=Math.random()*2; var ran_number=Math.round(ran_unrounded); document.write(eval("quote"+ran_number)); </SCRIPT> Code:
div class="sidebox"> <h1>Wise Words</h1> <p>"All one really needs to achieve something is practice, and the right tools."</p> <p class="align-right">- Me, <a href="http://www.novahq.net/">novahq.net</a></p> </div> I've tried several ways to fix this, but no luck. If someone could help, that would be totally awesome. Thanks guys. Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black |
#2
|
||
|
if you want every thing centered:
add an align=center to the div opening tag - like so Code:
div class="sidebox" align="center"> <h1>Wise Words</h1> <p>"All one really needs to achieve something is practice, and the right tools."</p> <p class="align-right">- Me, <a href="http://www.novahq.net/">novahq.net</a></p> </div> add align="center" to your opening <p> tag for the quote: Code:
<p align="center">"All one really needs to achieve something is practice, and the right tools."</p> |
#3
|
||
|
I tried doing that to this but it disappeared:
Code:
<SCRIPT> /* Script obtained from Wsabstract.com For this script and more Visit Java-Scripts.net or Wsabstract.com */ <p class="align-right">quote0= "Life is like a box of chocolates.";</p> quote1= "Java-Scripts.net is like a box of coco pops. "; quote2= "I have no idea what I am saying. "; var ran_unrounded=Math.random()*2; var ran_number=Math.round(ran_unrounded); document.write(eval("quote"+ran_number)); </SCRIPT> Also, one more question shall do (I really hate asking lots of questions to someone - as long as you're happy answering it, I'm happy too). I have this search box code here: Code:
<div class="searchform"> <form action="#"> <p> <input name="search_query" class="textbox" type="text" /> <input name="search" class="button" value="Search" type="submit" /> </p> </form> </div> If you could help getting it to work, that would be awesome. Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black |
#4
|
||
|
Lol I don't mind answering questions - Though to be honest why wait for a responce when a google search could give you the answer quicker?
For your quotes you want to write out the <p align="center"> code with the qoute So either something like quote0="<p align='center'>My qoute</p>"; document.write(quote0); (notice that I used in the align code in text for the variable) Or document.write('<p align="center">' + quote0 + '</p>'); For the search engine you need something in the action attribute so it knows what to do with it. for example: a simple form to display a name using php: html page form Code:
<form action="submit.php" method="get"> <input name="p_name" type="text" /> <input type=submit /> </form> Code:
<?php $p_name=$_GET["p_name"]; echo "Hello $p_name"; ?> I have only ever used php for form actions - you may want to read up on html forms. I know javascript can read the arguments passed to the page via the query string. IcI |
#5
|
||
|
K thanks man.
Google? Sometimes I use it, sometimes I don't. I don't always get the exact answer I need sometimes anyway with Google. Chris
__________________
Intel Core Duo E7300 2.66GHz // SuperTalent DDR2 800 2GB // ASUS nVidia GeForce 8400GS 512MB // Western Digital 7200RPM 320GB SATA // LG GH-20LS 20X SATA DVD-RAM // Windows XP Pro 32-bit // Thermaltake XP550 NP 430W // Thermaltake SOPRANO SECC Black |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mature: adendume,another new quote | bigsmellyfart | Humor & Jokes | 0 | 06-26-2011 12:35 AM |
template alignment | -Tigger- | Web design and Programming | 0 | 01-01-2006 11:01 AM |
Quote Sig | Chels | Sigs and Graphics | 10 | 05-06-2005 10:20 AM |
Quote: | RoDent | Humor & Jokes | 0 | 03-09-2003 10:37 PM |
quote:I think this would be the end of BHD | (Old) | General Chat | 12 | 11-22-2002 08:46 PM |