Jump to content

Search the Community

Showing results for tags 'HTML'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 654 results

  1. form validation

    <!DOCTYPE HTML> <html> <head> <style> .error {color: #FF0000;} </style> </head> <body> <?php /** * Note that the salt here is randomly generated. * Never use a static salt or one that is not randomly generated. * * For the VAST majority of use-cases, let password_hash generate the salt randomly for you */ // define variables and set to empty values $usernameErr = $passwordErr = $firstnameErr = $emailErr = $genderErr = $websiteErr = ""; $username = $password = $firstname = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["username"])) { $usernameErr = "UserName is required"; } else { $username = test_input($_POST["username"]); if (!preg_match("/^[a-zA-Z ]*$/",$username)) { $usernameErr = "Only letters and white space allowed"; } } if (empty($_POST["password"])) { $passwordErr = "password word is required"; } else { $password = test_input($_POST["password"]); if (!preg_match("/^(?=[-_a-zA-Z0-9]*?[A-Z])(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\S{8,}/",$password)) { $passwordErr = "<br>Password must be a mixure of <br>no# and letters containing <br>upper & lower case letters <br>at least 8 charecters<br>long"; } } if (empty($_POST["firstname"])) { $firstnameErr = "FirstName is required"; } else { $firstname = test_input($_POST["firstname"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$firstname)) { $firstnameErr = "Only letters and white space allowed"; } } if (empty($_POST["email"])) { $emailErr = "Email is required"; } else { $email = test_input($_POST["email"]); // check if e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; } } if (empty($_POST["website"])) { $website = ""; } else { $website = test_input($_POST["website"]); // check if URL address syntax is valid (this regular expression also allows dashes in the URL) if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) { $websiteErr = "Invalid URL"; } } if (empty($_POST["comment"])) { $comment = ""; } else { $comment = test_input($_POST["comment"]); } if (empty($_POST["gender"])) { $genderErr = "Gender is required"; } else { $gender = test_input($_POST["gender"]); } } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?> <h2>PHP Form Validation Example</h2> <p><span class="error">* Required Fields</span></p> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Username:<br/> <input type="text" name="username" value="<?php echo $username;?>"> <span class="error">* <?php echo $usernameErr;?></span> <br><br> Password:<br/> <input type="password" name="password" value="<?php echo $password;?> ?> "> <span class="error">* <?php echo $passwordErr;?></span> <br><br> Firstname:<br/> <input type="text" name="firstname" value="<?php echo $firstname;?>"> <span class="error">* <?php echo $firstnameErr;?></span> <br><br> E-mail:<br/> <input type="text" name="email" value="<?php echo $email;?>"> <span class="error">* <?php echo $emailErr;?></span> <br><br> Website:<br/> <input type="text" name="website" value="<?php echo $website;?>"> <span class="error"><?php echo $websiteErr;?></span> <br><br> Comment:<br/> <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea> <br><br> Gender:<br/> <input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">Female <input type="radio" name="gender" <?php if (isset($gender) && $gender=="male") echo "checked";?> value="male">Male <span class="error">* <?php echo $genderErr;?></span> <br><br> <input type = "reset" name = "reset"/> | <input type="submit" name="submit" value="Submit"> </form> <h2><?php echo "WELLCOM!";?> <?php echo $username;?></h2> <?php $options = [ 'cost' => 9, 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM), ]; echo password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options); echo "<br>"; echo $firstname; echo "<br>"; echo $email; echo "<br>"; echo $website; echo "<br>"; echo $comment; echo "<br>"; echo $gender; ?> </body> </html> Hello I need some advise on this need to make sure this is correct . I took this form from w3shools a long time ago. I modified it with regular expressions went to php.net, pick the hash function manipulated the code a little bit just need to make sure it gonna fly thank you in advance
  2. W3 page on Color Standards X11 shows a 1-99 breakdown that I am familiar with over at Xxxxx (name redacted as advertising not welcomed). Namely, every Primary color can be applied using a fixed "primary" Hexadecimal stepping system. That system counts up using "primary" increments. Those increments diversify without color names. https://www.w3schools.com/colors/colors_x11.asp The W3 Schools page uses primary increments, but only for grey-scale. Here are the primary units for all colors. 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF X11 leans on photographic deployment of oil and tempera color names resulting in an expected tangle, excepting grey-scale. Given that every device has its own physical palette, and hence none see the same color called Bisque #ffe4c4, it would be rational to reset Bisque to a nearest Primary neighbor, and apply 99 primary increments from there. ... EEDDBB FFEECC 11FFDD ... This methodology provides SAFE Primary Colors for developers and frameworks; that is, SAFE COLORS for HTML5. SAFE applies to HTML as simply more rational. Compare 18-21 WEB SAFE colors in CSS 2.0. Using RGB, CMY, RYB color wheels, and thousands of proprietary (mostly patent) color wheels available today, what is wrong with a psychiatric, chemical, endocrine, artistic, and general scientific principal shared by all humans: namely, Primary Association? The very interesting thing about primary color associations, is that toward darkest and lightest increments, the primary increments tend to pure white and pure black, an exacting conformance with human vision. To accommodate that vision, oil and tempera artists have a full palette of color names awaiting digital presentation. Factually, more color names than we need. PRIMARY COLOR NAMES are an established and appropriate way forward. We can do it like certain other rational parties and each independently setup our own COLOR.CSS, using whatever color names we choose. Or we can proceed with primary conversion of Bisque 1-99 with nominal Bisque somewhere between 1 and 99. Not a great intellectual challenge, though time consuming (multiply by 145 today and 755 tomorrow). CMS frameworks have primary 'templates'. Operating systems, likewise. I cannot find an online public demonstration of the primary principals suited to HTML5+ technology, as discussed in this thread. A color tutorial on primary colors and 99 increments for each established color name would be an interesting read. And help in understanding of color implementation. How many potential color names? Count the primary units above: (99 x 15) x 3 = 4,445 (my stats are very rusty). Nominal primaries are much more do-able: 15 x 15 = 225 color names for today's 1-F framework. 145 falls short by 80 color names. We can distributes primary increments to color names accordingly, with thousands of primary slots available. Primary color association leaves potentially millions of unique no-name colors to code. This thread begins with a simplistic way of observing complex and dynamic color theory. Color needs a simple framework. W3 Schools has a simple tutorial on Primary Digital Color?
  3. Dear potential helpers, I try to darken the foreground of my website using a background-color. I created a div which wraps all my other HTML stuff, applied position: relative; to it and a very great z-Index of 999. All my other elements have a z-index of 100 or lower. Why isn't my div not shown in front of the other stuff? In case the background-color of my div foreground is only shown behind all the other elements inside it. Here is my HTML: <html> <body> <div id="foreground"> <!-- All my other HTML stuff having relative positioning and z-index 100 or less --> </div> </body> </html> Here is my CSS: #foreground { position: relative; z-index: 999; display: block; background-color: red; } Maybe u guys have any idea what the matter with this one. Thank you!
  4. Page name id into href

    Is there a way for creating a template in html (css/java/php) for having a tag/id with page name to be used into links? Something like: <head> #name="this_is_page_name" #folder="part_of_location" </head> <body> <a href="111111/#folder/222222_#name.html">...</a> </body> Thanks!
  5. Small Group Projects

    I think it would be great to have small group projects .We could build login system; with air tight state of the art security, photo gallary's, audio gallery's. I think it would be a great tool for learning web development . Just a thought.
  6. Hello, I have another issue. I am using wordpress to build a new website. The theme has a slide show which loads its pictures from the featured images of my pages. I would like to hide a certain featured image of a certain page whilst I still have it on the slideshow. Is this possible?? Thank you in advance!
  7. echo("<HTMLstuff>"); not working?

    Harrow fellow campaigners, no idea what is going wrong here. Maybe anybody has a solution: Assume $logged_in being true. check_account_status() not firing. Also tried to change the attribute to onclick, onmousedown etc. The HTML (.php): <div id="wrapper-secondnav" class=""> <ul id="secondnav"> <li><a target="_blank" href="">Stuff</a></li> <li><a href="">Things</a></li> <li><a target="_blank" href="">Somestuff</a></li> <li><a href="">Anything</a></li> <?php if ($logged_in != true) { echo('<li><a id="register">Nooo</a></li>'); } else { echo('<li><a id="register" onload="check_account_status();">Yay</a></li>'); } ?> </ul> </div> And then there is the function in JS: function check_account_status() { alert("I like cookies"); } Thank you very much!
  8. Multiple Slideshows on one page

    Hi everyone. I need help. I am using this slideshow https://www.w3schools.com/howto/howto_js_slideshow.asp for a new site I'm building. I want to to put multiple slideshows on the same page. I can't seem to find out how to target each java script to each slideshow. What happens is that each "dot" will change the pictures on the same slideshow. Let me know if you need any other details. Thanks so much in advance!
  9. Hello I am wondering how to make a randomly teleporting button that makes noise and shows an Android toast when the button is clicked. If anyone knows how to do this please tell me I tried looking on Google and the only thing that comes up is Minecraft...
  10. Creating a view of an excel sort

    I want to create a spreadsheet and then do a sort and display that sort as my html. Is there an easy way to do that?
  11. href="?value = ..."

    I recently stumbled on still another piece of code to which I am not accustomed <a href="?edit=<?php echo $row['obs']; ?>" onclick="return confirm('sure to edit !'); " >edit</a> How does one read the phrase ?edit= in plain English? Roddy
  12. Please consider the following two sets of code. Are they not identical in their functionality? BACKGROUND: I am troubled by the following set of code, for it intertwines PHP and HTML in a way that, for me, is neither intuitive, nor reasonable based on my limited knowledge of how PHP and HTML work. This said, it appears to work. <?php if(isset($_GET['edit'])) { ?> <button type="submit" name="update">update</button> <?php } else { ?> <button type="submit" name="save">save</button> <?php } ?> ANALYSIS: Had I written the code I would have felt compelled to enter the <button> elements as part of PHP echo statements. QUESTION: Is this proper coding technique? Roddy
  13. BACKGROUND: Please go to the following webpage and note four different ways to fill the center section. 1) The center section is loads with the rest of the page as the content of <div id='main'> 2) The center is replaced with hidden content already on the page using jQuery's html( ) function. (Click in the navigation panel on the phrase "Form, Use, and Meaning'.) 3) The center is replaced with a portion of content from another page using jQuery's load( ) function. (Click in the navigation panel on the phrase "Words, Phrases, and Clauses".) 4) The center will be replaced with its original content, but without having to reload the page. The principle is the same as in Item 2, but the link mechanism is different. (Click on the host's image.) DILEMMA: I want to fill the same section with an HTML-formatted template filled with information from a data base that opens simultaneously with the page. CONSTRAINTS: 1) The host page for the content -- namely, podcasts_dev_copy.php is structurally complete. Any changes that I make to it should be minor. 2) The content of the middle section must be filled invisibly before the host page opens, or it must fill simultaneously with the host page. RESOURCES: 1) I have developed a PHP page that takes information sent to it from a 3rd party HTTP request, downloads data from a database that is based on the request, and opens to the host page with a portion of the processed information using a $_SESSION superglobal and the PHP header( ) function and location property. (This page has not been posted.) 2) A template engine that generates the replacement content from the same $_SESSION superglobal Have you got any ideas? Roddy
  14. $SERVER['QUERY_STRING']

    QUESTION: What does it mean when the value of the QUERY_STRING looks like the following without end? &width=1920&height=1200&width=1920&height=1200&... Roddy
  15. How to auto create a new page based on inputs

    My school asked me for a website where they can post their pictures on. Pictures from camp/city trips etc. I said that I never build a website before, but I would like to try it. So I googled and googled, then almost a week later I have this (code is below the text) I still have one problem: I have a login page which can be accessed by the teachers, I have a upload button and a name field, so every time when they have new pictures they can upload them and choose a name. But there isn't happening anything with the data. Is it possible that it automatically creates a page based on a tamplate with the before indicated input? I read something about get and post, but I have no idea how I could use that. I also read something about MySQL, but I have absolutely no idea how I could use something like that. So my question: How can I automatically create a new page, based on the input from another page. This is the website: http://thorbeckefotos.tk/ In the top right corner is a small login button, if you press the botton, you go to the login page (username: user password: password) if you continu you see the page that can be accessed by the teachers. Tamplate code: <!DOCTYPE html> <html> <head> <title>Thorbecke foto's</title> </head> <link rel="icon" href="images/logos/thorbecke.png"> <body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF"> <img src="images/Banner.png"> <a href="https://twitter.com/ThorbeckeSG"> <img src="images/logos/twitter.png" style="position:absolute; top: 5px; right: 153px;"></a> <a style="position:absolute; top: 12px; right: 20px;" href="https://twitter.com/ThorbeckeSG">Thorbecke Twitter</a> <a href="http://www.thorbecke-zwolle.nl"> <img src="images/logos/thorbecke.png" style="position:absolute; top: 37px; right: 163px"></a> <a style="position:absolute; top: 42px; right: 40px;" href="https://www.thorbecke-zwolle.nl">Thorbecke Site</a> <a href="https://www.youtube.com/channel/UCcGO0gpLrWdWMxmycPjh7Bg"> <img src="images/logos/youtube.png" style="position:absolute; top: 70px; right: 153px"></a> <a style="position:absolute; top: 72px; right: 5px;" href="https://www.youtube.com/channel/UCcGO0gpLrWdWMxmycPjh7Bg">Thorbecke YouYube</a> <a href="contact/index.php"> <img src="images/logos/contact.png" style="position:absolute; top: 92px; right: 153px"></a> <a style="position:absolute; top: 100px; right: 92px;" href="../contact/index.php">Contact</a> <br> <br> <br> </body> <link href='style.css' rel='stylesheet'> <ul> <li><a href="../index.htm">Home</a></li> <li><a>2017/18</a> <ul> <li><a href="Examenreis_Berlijn.htm">Examenreis Berlijn</a></li> <li><a href="Examenreis_Londen.htm">Examenreis Londen</a></li> <li><a href="Examenreis_Parijs.htm">Examenreis Parijs</a></li> <li><a href="Disco.htm">Disco klas 1</a></li> <li><a href="Biodag.htm">Biodag 3M</a></li> <li><a href="Introductie.htm">Introductie klas 3/4M</a></li> </ul> </li> <li><a>2016/17</a> <ul> <li><a href="../2016,17/Werkweek.htm">Werkweek</a></li> <li><a href="../2016,17/Grote_Avond.htm">Grote Avond</a></li> <li><a href="../2016,17/Skiereis.htm">Skireis</a></li> <li><a href="../2016,17/Diploma_uitreiking_Atheneum.htm">Diploma uitreiking Atheneum</a></li> <li><a href="../2016,17/Diploma_uitreiking_Havo.htm">Diploma uitreiking Havo</a></li> <li><a href="../2016,17/Diploma_uitreiking_Mavo.htm">Diploma uitreiking Mavo</a></li> <li><a href="../2016,17/Galaklas2.htm">Gala klas 2</a></li> <li><a href="../2016,17/Examenreizen.htm">Examenreizen</a></li> <li><a href="../2016,17/Brugklasdisco.htm">Brugklasdisco</a></li> <li><a href="../2016,17/Introductie.htm">Introductie klas 1M/H/A 3M 4A</a></li> <li><a href="../2016,17/Open_Dag.htm">Open Dag</a></li> </ul> </li> <li><a>2015/16</a> <ul> <li><a href="../2015,16/Diploma_uitreiking_Atheneum.htm">Diploma uitreiking Atheneum</a></li> <li><a href="../2015,16/Diploma_uitreiking_Havo.htm">Diploma uitreiking Havo</a></li> <li><a href="../2015,16/Diploma_uitreiking_Mavo.htm">Diploma uitreiking Mavo</a></li> <li><a href="../2015,16/Ijsverkoop_onioth.htm">Ijsverkoop Onioth</a></li> <li><a href="../2015,16/Onioth_kamp.htm">Onioth kamp</a></li> <li><a href="../2015,16/Werkweek.htm">Werkweek</a></li> <li><a href="../2015,16/Talendorp.htm">Talendorp</a></li> <li><a href="../2015,16/Skiereis.htm">Skireis</a></li> <li><a href="../2015,16/Going_Global.htm">Going Global</a></li> <li><a href="../2015,16/Open_Dag.htm">Open Dag</a></li> </ul> </li> <li><a>2014/15</a> <ul> <li><a href="../2014,15/kerstdinner.htm">Kerstdinner 4/5H</a></li> <li><a href="../2014,15/Munster.htm">Münster</a></li> <li><a href="../2014,15/Gala_klas_2.htm">Gala klas 2</a></li> <li><a href="../2014,15/Grote_Avond.htm">Grote Avond</a></li> <li><a href="../2014,15/Lisabon.htm">Lissabon</a></li> <li><a href="../2014,15/Londen.html">Londen</a></li> <li><a href="../2014,15/parijs.htm">Parijs</a></li> <li><a href="../2014,15/Barcelona.htm">Barcelona</a></li> <li><a href="../2014,15/Auditie_Grote_Avond.htm">Auditie Grote Avond</a></li> <li><a href="../2014,15/Stadshangenrun.htm">Stadshagenrun</a></li> </ul> </li> </ul> <br> <br> <br> <br> <center> <h1>Disco klas 1 2017/18</h1> <img src="images/Disco/breed001.jpg"> <img src="images/Disco/breed002.jpg"> <img src="images/Disco/breed003.jpg"> <img src="images/Disco/breed004.jpg"> <img src="images/Disco/breed005.jpg"> <img src="images/Disco/breed006.jpg"> <img src="images/Disco/breed007.jpg"> <img src="images/Disco/breed008.jpg"> <img src="images/Disco/breed009.jpg"> <img src="images/Disco/breed010.jpg"> <img src="images/Disco/breed011.jpg"> <img src="images/Disco/breed012.jpg"> <img src="images/Disco/breed013.jpg"> <img src="images/Disco/breed014.jpg"> <img src="images/Disco/breed015.jpg"> </center> <footer><h2><a font color="white" href="*download_url*">Download</h2></font></a> <h5>Gemaakt door Martijn Schuman</h5> <h5> Copyright 2017 All rights reserved. </h5> </footer> </html> Upload page code: <?php // Start the session ob_start(); session_start(); // Check to see if actually logged in. If not, redirect to login page if (!isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] == false) { header("Location: index.php"); } ?> <html> <head> <title>Thorbecke fotos upload</title> </head> <link rel="icon" href="images/logos/thorbecke.png"> <link href='style.css' rel='stylesheet'> <body> <img src="images/Banner.png"> </body> <form method="post" action="logout.php"> <input type="submit" value="Logout"><br> </form> <h2>Op deze pagina kan u een nieuwe activiteit aanmaken en foto's uploaden.</h2> <label for="activiteit">Activiteit:</label><br/> <input type="activiteit" placeholder="Activiteit"><br/> <br> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="files[]" multiple> <input type="submit" value="Upload"> </form> </html>
  16. 2 Submits in a form

    I need two submit buttons in my form, first is going to show result in the same tab and another one is in another one. <submit target="_blank"> is not correct. <target="_blank"> is for <form> tag, right?
  17. Same Page HTTP Request

    BACKGROUND: I have some PHP code that I would like to turn on and off from two different approaches: on the one hand, via an HTTP Request from a third-party domain; and on the other hand, via the href attribute of an HTML <a> tag on the same page. Under normal circumstances one might write something like case one. I am proposing cases two and three. Third Party Domain HTTP Request (CASE ONE): Podcast No. 3 <a href='www.grammarcaptive.com?hash=2348dd8we23jrkajddu&podcast_no=003' title='Podcast Overview' target='_blank'>Overview</a> Same Page HTTP Request (CASE TWO): Podcast No. 3 <a href='#podcast_003?hash=2348dd8we23jrkajddu&podcast_no=003' title='Podcast Overview' target='_blank'>Overview</a> Same Page HTTP Request (CASE THREE): Podcast No. 3 <a href='./?hash=2348dd8we23jrkajddu&podcast_no=003' title='Podcast Overview' target='_blank'>Overview</a> QUESTION ONE: If neither case two, nor three is permissible, how would you suggest to achieve the same goal. If either or both cases two or three are possible, which is preferable and why?
  18. Hello everyone I want to make a login page and I want to connect it with loptop or mobile fingerprint scanner and people can login with their fingerprint. Can anyone help me what should I do?
  19. University exam exercise

    Hi!! The day after tomorrow I've a HTML exam... Would you mind help me with this exercise?? I couldn't find the way to do it looking to the tutorials.. but if there is, and I missed it, let me now!! Create a HTML index.html containing a form: - with 2 text boxes to insert the name and the lastname; - a Submit button which sends the datas inserted by the user to a script php named namecontrol.php. Create a PHP page which has to visualize the datas sent from the form, as a list.
  20. BabyCam Code Help

    Hello world! First post. I am trying to get some code working to my liking that I found on the internet. I am in CS1 programming class but I do not know enough about Javascript to fix it. I am determined to finish this however. I would appreciate any help I can get. Here is the code: <!doctype html> <html> <head> <title>Security/BabyCam Revisited</title> <style type="text/css"> #container { /* center the content */ margin: 0 auto; text-align: center; } </style> </head> <body> <div id="container"> <img src="/?action=stream" /><br> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script><br /> <input type="range" min="10" max="170" value="85" step="1" onchange="showValue(this.value)/> <span id="range">10-170</span> <script type="text/javascript"> function showValue(newValue) { document.getElementById("range").innerHTML=newValue; } </script> <button onclick="servos.move('P', 5)">Left</button> <button onclick="servos.move('P', -5)">Right</button> <button onclick="servos.move('T', -5)">Down</button> <button onclick="servos.move('T', 5)">Up</button> </div> </body> <script> var servos; $( document ).ready(function() { servos = moveServos(); }); function moveServos() { // Store some settings, adjust to suit var panPos = 70, tiltPos = 90, tiltMax = 170, tiltMin = 45, panMax = 170, panMin = 20; return { move:function(servo, adjustment) { var value; if(servo == 'P') { if(!((panPos >= panMax && adjustment > 0) || (panPos <= panMin && adjustment < 0))) { // Still within allowed range, "schedule" the movement panPos += adjustment; } value = panPos + 'P'; } else if(servo == 'T') { if(!((tiltPos >= tiltMax && adjustment > 0) || (tiltPos <= tiltMin && adjustment < 0))) { // Still within allowed range, "schedule" the movement tiltPos += adjustment; } value = tiltPos + 'T'; } // Use AJAX to actually move the servo $.get('http://72.205.240.174:81/servos.rpy?value=' + value); }, } } </script> </html> This code has 4 buttons that work the two pan/tilt servos. I want to use a slider for left/right and another slider for up/down and in 1 degree increments rather than 5 degrees. You can see the output at 72.205.240.174:9000/index1.html. I added a slider, but I do not know Javascript enough to hook it into the actions. Once this is over, I will be writing a very clear tutorial on how everyone can make this from scratch like I did for Samba here: http://devestechnet.com/NewTech/PiSamba Thank you!
  21. I have referenced the W3 slideshow tutorial here and added two slideshows to my web page using Dreamweaver. I understand that the Javascript needs to be edited to accommodate 2 slideshows (divs vs. classes i think?), and I have tried to follow the instructions given here in order to edit it. Both of my slideshows seem to work independently now, but i can't figure out how to edit the Javascript to make the dots work right. The hover color works (red), but on the second slideshow, the dots do not turn red as the slideshow is advanced. I know very little about Javascript and I have gone through the Javascript tutorial, but I haven't landed on a solution. I've also searched the forums for an answer, but haven't found one that works for my specific situation. If anyone could point me toward a solution to have two slideshows on the page that both work pretty much like the one on the W3 tutorial page (with dots and arrows), I'd greatly appreciate your help — ANY guidance about how to fix the code is greatly appreciated. ~bex Here is my code: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * {box-sizing:border-box} body {font-family: Verdana,sans-serif;margin:0} .mySlides {display:none} /* Slideshow container */ .slideshow-container { max-width: 1000px; position: relative; margin: auto; } /* Next & previous buttons */ .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; } /* Position the "next button" to the right */ .next { right: 0; border-radius: 3px 0 0 3px; } /* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); } /* Caption text */ .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; } /* Number text (1/3 etc) */ .numbertext { color: #f2f2f2; font-size: 12px; padding: 8px 12px; position: absolute; top: 0; } /* The dots/bullets/indicators */ .dot { cursor:pointer; height: 13px; width: 13px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; } .active, .dot:hover { background-color: #f44336; } /* Fading animation */ .fade { -webkit-animation-name: fade; -webkit-animation-duration: 1.5s; animation-name: fade; animation-duration: 1.5s; } @-webkit-keyframes fade { from {opacity: .4} to {opacity: 1} } @keyframes fade { from {opacity: .4} to {opacity: 1} } /* On smaller screens, decrease text size */ @media only screen and (max-width: 300px) { .prev, .next,.text {font-size: 11px} } </style> </head> <body> <div id="wrapper"> <div class="slideshow w3-container w3-half"> <div class="w3-content w3-display-container"> <img class="mySlides fade" src="img_nature_wide.jpg" width="100%"> <img class="mySlides fade" src="img_fjords_wide.jpg" width="100%"> <a class="prev" onclick="plusDivs(-1, 0)">&#10094;</a> <a class="next" onclick="plusDivs(1, 0)">&#10095;</a> <!-- Extra plusDivs parameter refers to first (0) slideshow (start from 0) --> </div> <br> <div style="text-align:center"> <span class="dot" onclick="currentDiv(1)"></span> <span class="dot" onclick="currentDiv(2)"></span> </div> </div> <hr> <div class="slideshow w3-container w3-half"> <div class="w3-content w3-display-container"> <img class="mySlides fade" src="img_nature_wide.jpg" width="100%"> <img class="mySlides fade" src="img_fjords_wide.jpg" width="100%"> <a class="prev" onclick="plusDivs(-1, 1)">&#10094;</a> <a class="next" onclick="plusDivs(1, 1)">&#10095;</a> <!-- Extra plusDivs parameter refers to second (1) slideshow (start from 0) --> </div> <br> <div style="text-align:center"> <span class="dot" onclick="currentDiv(1)"></span> <span class="dot" onclick="currentDiv(2)"></span> </div> </div> <script> var slideIndex = 1; var z = document.getElementsByClassName("slideshow"); for (i = 0; i < z.length; i++) { //set custom data attribute to first current image index z[i].setAttribute("data-currentslide", 1); showDivs(z[i].getAttribute("data-currentslide"), i); } function plusDivs(n, j) { //get custom data attribute value of current image index to slideshow class index j slideIndex = parseInt(z[j].getAttribute("data-currentslide")[0]); showDivs(slideIndex += n, j); } function currentDiv(n,j) { showSlides(slideIndex += n, j); } function showDivs(n, j) { var i; var z = document.getElementsByClassName("slideshow")[j]; var x = z.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > x.length) { slideIndex = 1 } if (n < 1) { slideIndex = x.length; } //set custom data attribute to current image index z.setAttribute("data-currentslide", slideIndex); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } x[slideIndex - 1].style.display = "block"; dots[slideIndex - 1].className += " active"; } </script> </div> </body> </html>
  22. I am trying to find a solution to a problem that I have encountered while trying to get a fixed-top navigation menu to work dynamically in W3.CSS. By dynamically, I mean that the horizontally-orientated navigation bar should remain in its place under the page title and image until the page is scrolled downwards and reaches the top of the viewport. At this point, it should fix itself to the top of the screen. I have been able to achieve this effect using my own html/css and jquery script but this method doesn’t work as intended with W3.CSS. I have been moving my websites over to W3.CSS as I as a means of making them responsive and also because css is not my strong point and I like the W3.CSS structure. The menu bar operates as it should when it is in its static mode but, when it is fixed, which involves position:absolute and a z-index of 1, the dropdown menus no longer appear above the bar but are concealed within it. I have tried altering the z-index values of the dropdown-hover and dropdown-content elements but cannot find a solution to this problem. If there is anyone who can, I would be very grateful. The html code below is based closely on the “Navigation Bar with Dropdown” example taken from the W3.CSS Navigation Bars page. I also include the css used to fix the bar and the jquery function to call the css once the top of the screen is reached. HTML <div id=”container”> <div id=”header”></div> <img id="header_image" src="titleimage.jpg" alt="Header Image" class="header_image"/> <img id="header_image_m" src="title_image_m.jpg" alt="Header Image" class="header_image"/> <div id=”nav_bar_container> <div id=”nav_bar” class="w3-bar w3-light-grey"> <a href="#" class="w3-bar-item w3-button w3-mobile">Home</a> <a href="#" class="w3-bar-item w3-button w3-mobile">Link 1</a> <div class="w3-dropdown-hover"> <button class="w3-button">Dropdown</button> <div class="w3-dropdown-content w3-bar-block w3-card-4 w3-mobile"> <a href="#" class="w3-bar-item w3-button">Link 1</a> <a href="#" class="w3-bar-item w3-button">Link 2</a> <a href="#" class="w3-bar-item w3-button">Link 3</a> </div> </div> </div> </div> CSS #nav_bar_container, #nav_bar{ margin:0; padding:0; width:100%; max-width:948px; } .nav_bar_fixed { position:fixed; top:0px; z-index:1; } Jquery if ($( window ).width() > 600) { $(window).scroll(function() { var fixedBar = $('#nav_bar'), targetScroll = $('#nav_bar_container').position().top, currentScroll = $('html').scrollTop() || $('body').scrollTop(); fixedBar.toggleClass('nav_bar_fixed', currentScroll >= targetScroll); }); }
  23. Not sure if I worded that right. I am trying to ad a modal to our page. Eventually it will need to be more than one modal but one problem at a time. I am struggling to add multiple images in a modal where visitors can just click on the image and it will enlarge and they can scroll through them. Instead what happens is it gives me the images but no option to click on an arrow which means every image has to opened separately. Can someone help me please as I am not managing with google. This is the coding I found on W3Schools. I just copied and pasted it like I found it and just put my image tag in. I just can't figure out how to add more images. <!-- Trigger the Modal --> <img id="myImg" src="img/t1.jpg" alt="Tinkerbell Party" width="300" height="200"> <!-- The Modal --> <div id="myModal" class="modal"> <!-- The Close Button --> <span class="close" onclick="document.getElementById('myModal').style.display='none'">&times; </span> <!-- Modal Content (The Image) --> <img class="modal-content" id="img01"> <!-- Modal Caption (Image Text) --> <div id="caption"></div> </div> <html> <head> <style> #myImg { border-radius: 5px; cursor: pointer; transition: 0.3s; } #myImg:hover {opacity: 0.7;} /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.9); /* Black w/ opacity */ } /* Modal Content (image) */ .modal-content { margin: auto; display: block; width: 80%; max-width: 700px; } /* Caption of Modal Image */ #caption { margin: auto; display: block; width: 80%; max-width: 700px; text-align: center; color: #ccc; padding: 10px 0; height: 150px; } /* Add Animation */ .modal-content, #caption { -webkit-animation-name: zoom; -webkit-animation-duration: 0.6s; animation-name: zoom; animation-duration: 0.6s; } @-webkit-keyframes zoom { from {-webkit-transform:scale(0)} to {-webkit-transform:scale(1)} } @keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} } /* The Close Button */ .close { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; } .close:hover, .close:focus { color: #bbb; text-decoration: none; cursor: pointer; } /* 100% Image Width on Smaller Screens */ @media only screen and (max-width: 700px){ .modal-content { width: 100%; } } </style> </head> <body> <!-- The Modal --> <div id="myModal" class="modal"> <span class="close">&times;</span> <img class="modal-content" id="img01"> <div id="caption"></div> </div> <script> // Get the modal var modal = document.getElementById('myModal'); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById('myImg'); var modalImg = document.getElementById("img01"); var captionText = document.getElementById("caption"); img.onclick = function(){ modal.style.display = "block"; modalImg.src = this.src; captionText.innerHTML = this.alt; } // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } </script> </body> </html>
  24. Problem with Photo Image Layout

    I am trying to design my own mockup website based on one of the W3 templates; however, I could not get the photo images to lay out on my website the same way as the W3 template. Here is the W3 template that I was talking about: https://www.w3schools.com/w3css/tryw3css_templates_photo2.htm. And here is the following codes that I came up with for my website. Any feedback will help. HTML <!doctype html> <html> <head> <title>Amy Perrales | Photographer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> <link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet"> <link rel="stylesheet" href="css/font-awesome.min.css"> <!-- !PAGE CONTENT! --> <div class="photography" style="max-width:1500px"> <!-- Header --> <header class="panel" style="padding:128px; 16px;"> <h1 class="ap-xlarge">PHOTOGRAPHER</h1> <h1>Amy Perrales</h1> </head> <body> <div> <id class="introduction"> <a href="Home" style="text-decoration: none;">Home</a> <a href="Portfolio" style="text-decoration: none;">Portfolio</a> <a href="About Amy" style="text-decoration: none;">About Amy</a> <a href="Contact" style="text-decoration: none;">Contact</a> </div> </header> <!-- Photo Grid --> <div class="half-width"> <img src="img/amusement_park.jpg" alt="amusement park" style="width: 599px; height: 424px;"> <img src="img/dock-1365387_640.jpg" alt="dock" style="width:550px; height:633px;"> <img src="img/kaboompics_Black baby chicks.jpg" alt="baby chicks" style="width: 342px; height:513px;"> <img src="img/sunset-114557_640.jpg" alt="sunset" style="width: 275px; height: 550px;"> <img src="img/wedding_couple.jpg" alt="wedding couple" style="width:550px; height:412px;"> </div> <div class="full-width"> <img src="img/ballet-437990_640.jpg" alt="ballet dancer" style="width:424px; height="640px;"> <img src="img/baseball.jpg" alt="baseball player" style="width:424px; height="640px;"> <img src="img/dancer-2471026_640.jpg" alt="dancer" style="width:424px; height="640px;"> <img src="img/pool.jpg" alt="children and pool" style="width:424px; height="640px;"> </div> <!-- Footer --> <footer> <i class="fa fa-facebook-square" style="font-size:36px;"></i> <i class="fa fa-twitter-square" style="font-size:36px;"></i> <i class="fa fa-instagram" style="font-size:36px;"></i> <i class="fa fa-pinterest" style="font-size:36px;"></i> <i class="fa fa-linkedin" style="font-size:36px;"></i> </footer> </style> </body> </html> CSS /* ========================================================================== Base Styles ========================================================================== */ body,h1 { font-family: 'Slabo 45px', serif; text-align: center; letter-spacing: 6px; color: #9aa6b1; } a { color: #a9b3bc; border: 3px solid #fba69d; padding: 8px; margin-left: 3px; margin-right: 5px; } img { margin-bottom: 128px; width: 100%; height: auto; }
  25. Changing the place of input and label

    The html code is this : <div class="form-group"> <label class="col-sm-4 control-label">Checkbox inputs</label> <div class="col-sm-8"> <div class="checkbox check-transparent"> <input type="checkbox" value="1" id="opt01" checked> <label for="opt01">Option 1</label> </div> <div class="checkbox check-transparent"> <input type="checkbox" value="1" id="opt02"> <label for="opt02">Option 2</label> </div> <div class="checkbox check-transparent"> <input type="checkbox" value="1" id="opt03"> <label for="opt03">Option 3</label> </div> </div> </div> I attached the results photo : I want to change the place of checkbox and label I mean I want first be label and then checkbox. It had bootstrap too I uploaded the bootstrap files too : https://www.dropbox.com/s/kc8ytkkd5dxcmc1/assets.zip?dl=0 Who can say that how can I change the place of checkbox and label I will be thank.
×