Jump to content

AARRGGHHH

Members
  • Posts

    74
  • Joined

  • Last visited

Recent Profile Visitors

1,865 profile views

AARRGGHHH's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. I have been away from programming for quite a while due to health issues. I have an image editing page written in HTML5, CSS3, and JavaScript. No additional libraries. I believe I used the HTML5 API to create Save As JPEG with a quality setting or Save As PNG. This works fine on laptops and desktops and works fine on Android. It does not work on iPhone. IIRC, there is now a way for this to work on iPhone/iOS. How do I go about doing this? If I am incorrect and there is not a new method, what work arounds are available? Currently, the edited image opens in a new tab, and the user has to tap the image and then tap “save to photos”. Is there a less awkward work around? I know, I’m tired and rusty. So, thank you very much!
  2. Okay, makes sense. I'm guessing the "element inspector" is part of one of the major browser's troubleshooter. Which browser uses it? Where do I find it? Thank you!
  3. function hideElements() { document.getElementById('div1').style.display = "block"; document.getElementById('div2').style.display = "none"; document.getElementById('div3').style.display = "none"; document.getElementById('div4').style.display = "none"; document.getElementById('div5').style.display = "none"; hideScreenElements(); } How do I get the div that I'm hiding to stop taking up space when style.display = none? It's throwing off the vertical placement of a video beneath the divs that are set to none. Thank you
  4. I'm fairly certain that I tried that but I'll try it again to see what happens. Thanks
  5. Accomplished what I wanted with CSS Animation: <style> p {text-align: center;} #span0 { animation: animate 8s; animation-iteration-count: 1; } @keyframes animate { from {color: rgb(255,128,64);} to {color: black;} } </style> <div id="div0" style.display = "block";> <span id="span0">QUOTE GOES HERE</span><br><br> </div> But I am curious as to why I was unable to get it to work using the JavaScript setTimeout() function. If anyone knows, please share the knowledge! Thank you
  6. When I step through this, it never changes to black. It just stays red. <body onload = "hideQuote0();"> <script> function hideQuote0() { document.getElementById("span0").color = "rgb(255,0,0)"; setTimeout(hideQuote1(), 3000); } function hideQuote1() { document.getElementById("span0").color = "rgb(128,0,0)"; setTimeout(hideQuote2(), 3000); } function hideQuote2() { document.getElementById("span0").color = "rgb(0,0,0)"; } </script> <div id="div0" style.display = "block";> <span id="span0" color: rgb(0,0,0);> QUOTE GOES HERE </span><br><br> </div> ... </body> Thank you very much
  7. Okay, thank you very much The quotes in the parenthesis, is this correct?
  8. I appreciate your reply. I didn't quite catch what you meant by the above, can I ask you to clarify "looping through index's"? In regard to my "syntax error", if I understand correctly, the syntax and quotes are fine, the problem is the placement of the script in the "<head></head> area, correct? Thank you very much
  9. I don't recall ever having a problem with that. Are you saying that this code should be in the <body> and not the <head>? Are the quotes correct? Thank you very much
  10. for (i = 1; i = 5; i++) { document.getElementById("" + i + "").style.display = "none"; } Error: Uncaught TypeError: Cannot read properties of null (reading 'style') I'm going to have to write out all 5 lines of code because the loop won't work. So that this does not happen again, I'd appreciate if someone could tell me what rookie mistake I made. The quotes don't look right but nothing I tried fixed the error. Thank you!
  11. Did I mention "rusty"? for (var getHEX = 1; getHEX < 4; getHEX++) Thank you so much, Ingolme. If I hadn't already shaved my head, I would've been pulling my hair out over this one.
  12. I am rusty beyond words. This is selecting a random color in hexadecimal. Instead of selecting three colors (like #FF8000)(orange) the loop never ends, and the page is never able to load. It just keeps making that hex color code longer (#FF8080FCAD694897... etc...). Apologies for the somewhat amateurish question. // Use random number to select primary and secondary colors var color = Math.floor((Math.random() * 8) + 1); if (color == 1) copy.style.stroke = "#FF0000"; // red if (color == 2) copy.style.stroke = "#FF8000"; // orange if (color == 3) copy.style.stroke = "#FFFF00"; // yellow if (color == 4) copy.style.stroke = "#00FF00"; // green if (color == 5) copy.style.stroke = "#0080FF"; // blue if (color == 6) copy.style.stroke = "#FF00FF"; // purple if (color == 7) copy.style.stroke = "#FFFFFF"; // white // Add some random colors. var hexString = "#"; if (color == 8) { // generate random color var min = 128; var max = 255; var range = 1 + max - min; for (var getHEX = 1; getHEX = 3; getHEX++) { var randomNumber = Math.floor(Math.random() * range + min); // Convert to hex randomNumber = randomNumber.toString(16); // Concatenate until I have a color for all three color channels hexString = hexString + randomNumber; // It should exit here. But it doesn't. It goes into an infinite loop creating an endless string of hex codes... }; copy.style.stroke = hexString; };
  13. I didn't know toString() could change base. That's VERY informative. As is choosing a random between two numbers. I was going about it entirely the wrong way. Thank you very much!
  14. I need to create a random number between two numbers. For example, between 64 and 255. I then need to convert that number to hex. Assistance is appreciated. Thank you!
×
×
  • Create New...