Jump to content

Andrew2010

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Andrew2010's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the response. I sort of get it. But still having trouble understanding how to write it. Javascript always gets me. Could you show how to write it? Like, I see what you did for the basic.js but what would I need to include in the HTML coding?
  2. So I am using the simple modal javascript script, but I am stuck. On my site I have a list of insect orders, and I want different information to be displayed for each link thats in the bullet list. Please visit my test site to see what I am doing: http://test.bug-catcher.com/ (in the North American Insects tab, please click on one of the bullet list links (e.g. Blattaria (Cockroaches.)) Now if you click each link you'll see the same content pop up, I would like it so each insect order has different content. Can someone please help me do this? basic.js: jQuery(function ($) { $('#basic-modal .basic').click(function (e) { $('#basic-modal-content').modal(); return false; }); }); HTML: <ul class="service_list"> <div id='basic-modal'> <li><a href="#" class="basic">Blattaria (Cockroaches)</a></li> <li><a href="#" class="basic">Coleoptera (Beetles)</a></li> <li><a href="#" class="basic">Dermaptera (Earwigs)</a></li> <li><a href="#" class="basic">Diptera (True Flies)</a></li> <li><a href="#" class="basic">Embiidina (Webspinners)</a></li> <li><a href="#" class="basic">Ephemeroptera (Mayflies)</a></li> <li><a href="#" class="basic">Hemiptera (Aphids, Cicadas & True Bugs)</a></li> <li><a href="#" class="basic">Hymenoptera (Ants, Bees & Wasps)</a></li> <li><a href="#" class="basic">Isoptera (Termites)</a></li> <li><a href="#" class="basic">Lepidoptera (Butterflies & Moths)</a></li> <li><a href="#" class="basic">Mantodea (Mantids)</a></li> <li><a href="#" class="basic">Mecoptera (Scorpionflies & Hangingflies)</a></li> <li><a href="#" class="basic">Microcoryphia (Bristletails)</a></li> <li><a href="#" class="basic">Neuroptera (Net-winged Insects)</a></li> <li><a href="#" class="basic">Notoptera (Rock Crawlers)</a></li> <li><a href="#" class="basic">Odonata (Dragonflies & Damselflies)</a></li> <li><a href="#" class="basic">Orthoptera (Grasshoppers & Their Kin)</a></li> <li><a href="#" class="basic">Phasmida (Walkingsticks)</a></li> <li><a href="#" class="basic">Phthiraptera (Lice)</a></li> <li><a href="#" class="basic">Plecoptera (Stoneflies)</a></li> <li><a href="#" class="basic">Psocoptera (Booklice & Barklice)</a></li> <li><a href="#" class="basic">Raphidioptera (Snakeflies)</a></li> <li><a href="#" class="basic">Siphonaptera (Fleas)</a></li> <li><a href="#" class="basic">Strepsiptera (Twisted-winged Insects)</a></li> <li><a href="#" class="basic">Thysanoptera (Trips)</a></li> <li><a href="#" class="basic">Trichoptera (Caddisflies)</a></li> <li><a href="#" class="basic">Zygentoma (Silverfish)</a></li> </div> </ul> </p> <!-- modal content --> <div id="basic-modal-content"> <h3>Blattaria (Cockroaches)</h3> <p>For this demo, SimpleModal is using this "hidden" data for its content. You can also populate the modal dialog with an AJAX response, standard HTML or DOM element(s).</p> </div> <!-- preload the images --> <div style='display:none'> <img src='img/basic/x.png' alt='' /> </div> </div>
  3. Thank you! I am so getting rusty. lol. Appreciated.
  4. When I press submit on the form, I do receive the email, but the text in the fields don't show up. How do I fix this? Thanks. FORM CODE: <form method="post" id="contacts-form" action="process.php"> <fieldset> <div class="rowElem"> <input type="text" value="Name:" onFocus="if(this.value=='Name:'){this.value=''}" onBlur="if(this.value==''){this.value='Name:'}"> </div> <div class="rowElem"> <input type="email" value="E-mail:" onFocus="if(this.value=='E-mail:'){this.value=''}" onBlur="if(this.value==''){this.value='E-mail:'}"> </div> <textarea onFocus="if(this.value=='Message:'){this.value=''}" onBlur="if(this.value==''){this.value='Message:'}">Message:</textarea> <div class="alignright"><input value="Submit" type="submit" name="submit"></div> </fieldset> </form> PHP CODE: <?php if(isset($_POST['submit'])) { $to = 'example@example.com' ; //put your email address on which you want to receive the information $subject = 'Contact Form'; //set the subject of email. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $message = "<table><tr><td>Name</td><td>".$_POST['Name:']."</td></tr> <tr><td>E-Mail</td><td>".$_POST['E-mail:']."</td></tr> <tr><td>Message</td><td>".$_POST['Message:']."</td> </tr></table>" ; mail($to, $subject, $message, $headers); header('Location: contact.php'); } ?>
  5. I tried what you said, it adds 6 only on the first row. Here's the code with linebreaks: document.write('<div align="center"><table cellpadding="0" cellspacing="0" border="0">');for (var a = 0; a <= 5; a++) {document.write('<tr>');for (var b = 0; b <= 4; b++) {document.write('<td align="center" class="blk" id="t'+((5*a)+b)+'"></td>');} document.write('<\/tr>');}document.write('<\/table><form name="mem"><input type="button" id="cnt" value="0:00" onclick="window.start()" \/><\/form><\/div>');
  6. Hi everybody, I've added a memory game to my site. The game has 6 rows, and 5 columns (30 cards), and I was wondering if someone could fix the script so it has 5 rows and 6 colums. I'm not sure which script controls it, so here's them both: document.write('<div align="center"><table cellpadding="0" cellspacing="0" border="0">');for (var a = 0; a <= 5; a++) {document.write('<tr>');for (var b = 0; b <= 4; b++) {document.write('<td align="center" class="blk" id="t'+((5*a)+b)+'"></td>');}document.write('<\/tr>');}document.write('<\/table><form name="mem"><input type="button" id="cnt" value="0:00" onclick="window.start()" \/><\/form><\/div>'); var back = 'images/back.gif'; var tile = ['images/card0.gif','images/card1.gif','images/card2.gif','images/card3.gif','images/card4.gif','images/card5.gif', 'images/card6.gif','images/card7.gif','images/card8gif','images/card9.gif','images/card10.gif','images/card11.gif', 'images/card12.gif','images/card13.gif','images/card14.gif']; function randOrd(a, b){return (Math.round(Math.random())-0.5);} var im = []; for (var i = 0; i < 15; i++) {im[i] = new Image(); im[i].src = tile[i]; tile[i] = '<img src="'+tile[i]+'" width="60" height="100" alt="" \/>'; tile[i+15] = tile[i];} function displayBack(i) {document.getElementById('t'+i).innerHTML = '<div onclick="disp('+i+');return false;"><img src="'+back+'" width="60" height="100" alt="back" \/><\/div>';} var ch1, ch2, tmr, tno, tid, cid, cnt; window.onload=start; function start() {for (var i = 0; i <= 29 ;i++) displayBack(i);clearInterval(tid);tmr = tno = cnt = 0;tile.sort( randOrd );cntr(); tid = setInterval('cntr()', 1000);} function cntr() {var min = Math.floor(tmr/60);var sec = tmr%60;document.getElementById('cnt').value = min+':'+ (sec<10 ? '0' : '') + sec;tmr++;} function disp(sel) {if (tno>1) {clearTimeout(cid); conceal();}document.getElementById('t'+sel).innerHTML = tile[sel];if (tno==0) ch1 = sel;else {ch2 = sel; cid = setTimeout('conceal()', 900);}tno++;} function conceal() {tno = 0; if (tile[ch1] != tile[ch2]) {displayBack(ch1);displayBack(ch2);} else cnt++; if (cnt >= 15) clearInterval(tid);} Thanks!!
  7. You're a genus! Thanks so much. No one else understood what I was talking about, the script you gave me is wondeful!
  8. I need a php script that loads a random image in a set poistion, on page. Anyone have such a script?
  9. I know that the "document.write" section of the code controls all images, but I need to know how do I get it to control just one of each image? As you can see, I need each image to have its OWN set positions. function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="images/insects/Green Stink Bug.png" myimages[2]="images/insects/Green Stink Bug.png" myimages[3]="images/insects/Green Stink Bug.png" myimages[4]="images/insects/Green Stink Bug.png" myimages[5]="images/insects/Green Stink Bug.png" myimages[6]="images/insects/Bush-Katydid.gif" myimages[7]="images/insects/Bush-Katydid.gif" myimages[8]="images/insects/Bush-Katydid.gif" myimages[9]="images/insects/Bush-Katydid.gif" myimages[7]="images/insects/Common Walkingstick.png" myimages[8]="images/insects/Common Walkingstick.png" myimages[9]="images/insects/Common Walkingstick.png" //specify corresponding links below var imagelinks=new Array() imagelinks[1]="captured.php" imagelinks[2]="captured.php" imagelinks[3]="captured.php" imagelinks[4]="captured.php" imagelinks[5]="captured.php" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img style="POSITION: absolute; TOP: 170px; LEFT: 50px" border =0 hspace=0 src="'+myimages[ry]+'" width=70 height=163></a>') } random_imglink()
  10. I know that the "document.write" section of the code controls all images, but I need to know how do I get it to control just one of each image? function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="images/insects/Green Stink Bug.png" myimages[2]="images/insects/Green Stink Bug.png" myimages[3]="images/insects/Green Stink Bug.png" myimages[4]="images/insects/Green Stink Bug.png" myimages[5]="images/insects/Green Stink Bug.png" myimages[6]="images/insects/Bush-Katydid.gif" myimages[7]="images/insects/Bush-Katydid.gif" myimages[8]="images/insects/Bush-Katydid.gif" myimages[9]="images/insects/Bush-Katydid.gif" myimages[7]="images/insects/Common Walkingstick.png" myimages[8]="images/insects/Common Walkingstick.png" myimages[9]="images/insects/Common Walkingstick.png" //specify corresponding links below var imagelinks=new Array() imagelinks[1]="captured.php" imagelinks[2]="captured.php" imagelinks[3]="captured.php" imagelinks[4]="captured.php" imagelinks[5]="captured.php" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img style="POSITION: absolute; TOP: 170px; LEFT: 50px" border =0 hspace=0 src="'+myimages[ry]+'" width=70 height=163></a>') } random_imglink()
  11. Actually, I came up with a new javascript script, seen here: <script language="JavaScript"> <!-- function random_imglink(){ var myimages=new Array() //specify random images below. You can have as many as you wish myimages[1]="images/insects/Chinese Mantis Green Version.png" myimages[2]="images/insects/Green Stink Bug.png" myimages[3]="images/insects/Earwig.png" //specify corresponding links below var imagelinks=new Array() imagelinks[1]="index.html" imagelinks[2]="index.html" imagelinks[3]="index.html" var ry=Math.floor(Math.random()*myimages.length) if (ry==0) ry=1 document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img style="POSITION: absolute; TOP: 244px; LEFT: 410px" border =0 hspace=0 src="'+myimages[ry]+'" width=70 height=33></a>') } random_imglink() //--> </script> This seems to be great, so far, just one simple thing. I know the document.write controls all the images, but each image I’m using has different set positions. How do I do this without affecting ALL the other images?
  12. Thanks for the reply, I appreciate it a lot. I'm basic at PHP, but I sort of understand the array function. Something like this? <?php // Define array. $images = array('/images/1.jpg', '/images/2.jpg', '/images/3.jpg'); // Get random key and output array element into an image tag. echo '<img src="' . $images[array_rand($images, 1)] . '" />'; ?> One problem though, is there any way to position each image individually? Like, say I want image 1 to be TOP: 244px; LEFT: 410px, image 2 to be TOP: 540px; LEFT: 200px, etc.
  13. I can't find any help with this. Ok, here's what I need: I have a page called woodland.php, where I want a random image in a set position generated on page load. I have this done with HTML, but with that I have to make a page for every image! Seen here: <script language="JavaScript"> <!-- Begin var howMany = 10; // max number of items listed below var page = new Array(howMany+1); page[0]="earwig.htm"; page[1]="mantis.htm"; page[2]=""; page[3]=""; page[4]=""; page[5]=""; page[6]="firefly.htm"; page[7]=""; page[8]=""; page[9]="ant.htm"; page[10]=""; function rndnumber(){ var randscript = -1; while (randscript < 0 || randscript > howMany || isNaN(randscript)){ randscript = parseInt(Math.random()*(howMany+1)); } return randscript; } quo = rndnumber(); quox = page[quo]; window.location=(quox); // End --> </script>: I place the image I want to load on each page, seen here: <a href="capture.php"><img style="POSITION: absolute; TOP: 244px; LEFT: 410px" border =0 hspace=0 src ="images/insects/Earwig.png" width=70 height=33 ></a> Is there a way to generate these images on page load, in the same way as above, but without creating a new page for EVERY image?! There has to be a way to do this with PHP. Once again, I need to generate these images on woodland.php and not having to make a page for every image I generate. This way, users can't find these images with a address. PLEASE HELP!
×
×
  • Create New...

Important Information

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.