Jump to content

Ingolme

Moderator
  • Posts

    14,890
  • Joined

  • Last visited

  • Days Won

    174

Everything posted by Ingolme

  1. If they're greyscale, all the images will have the same value for the red, green and blue channels. CSS doesn't let you tint the background images. If the source images are already visibly red, or cyan, it should work as it is. You can use <canvas> with Javascript to composite the images, but it's not exactly simple. You need to learn how to program on the canvas, then you can grab pixel data from each of the images and composite them manually.
  2. The image file needs to have been square to begin with.
  3. I'd say there's not much left in it. The Discord channel is where everyone went.
  4. Ingolme

    Schema - Help

    I cannot allow you to post links to your website. For adding schema, look online for documentation about your CMS, which is probably Wordpress. Here's a schema plug-in for Wordpress: https://wordpress.org/plugins/schema/
  5. A simple solution would be to allow horizontal scrolling on the container and then make the image size larger on small screens. For this to work, each comic panel needs be within a third of the width of the image. Different spacing between the panels might cause them to not line up perfectly. HTML: <div class="strip"> <img src="comic-strip.png" alt="Comic strip"> </div> CSS: .strip { overflow: auto; } .strip img { display: block; width: 100%; } @media screen and (max-width:768px) { .strip-img { width: 300%; } }
  6. On Windows, most browsers use the F12 key to open the element inspector. You can also find it by right-clicking anywhere on a page and selecting "Inspect" from the context menu.
  7. It doesn't take space when the display is "none", you should use the element inspector to see which element is actually taking up the space.
  8. There must be other code with higher precedence putting a border on the image, or the border is on a parent element of the image, or the border is actually part of the image file. Without seeing the rest of the code there's no way to know.
  9. None of that HTML does anything on its own. We would need to see what the Javascript code looks like.
  10. This is one way to do it. if(location.search) { location.href = location.pathname; } It causes a page reload, though. The history API lets you change the URL without reloading, but I've seen it misused a lot, causing websites to not function as expected. https://developer.mozilla.org/en-US/docs/Web/API/History/pushState
  11. Just check the tutorial page again: https://www.w3schools.com/js/js_loop_for.asp This code is trying to access HTML elements. You must make sure that this code doesn't run until after those elements have been loaded, otherwise it won't find them.
  12. You need to call setLogger() logger.log(LogStatus.INFO, "create account test8"); DataDriven dataDriven = new DataDriven(); dataDriven.setLogger(logger); dataDriven.launchExcelFile("TestData.xls", "profiles");
  13. You can't. They are completely different objects with no connection to each other. If you put the string "Mike" into object A and then ask object B for the string you won't find it there. When you write setName("Mike") it's a shorthand for calling this.setName("Mike") and this is an object. Then you have a completely different object called getData. You haven't written getData.setName("Mike") so it won't give you anything. For your test to make sense you need to write this code: public class CreateAccount { @Test public void test1() { GetData getData = new GetData(); getData.setName("Mike"); String name = getData.GetMyData(); System.out.println("get name: " + name); } } Why exactly do you want two different objects to point to the same data?
  14. You created a new GetData instance on this line: GetData getData = new GetData(); It currently has nothing in it because you only just created it. You need to call setName() to give it a value before you can read it.
  15. You need a loop. You can use indexOf() and go changing the initial offset until you've found all the matches. When it returns -1 there are no more matches. String words = "I go to summer school. I also go to winter school"; int counter = 0; int start = words.indexOf("e"); while(start > -1) { counter++; start = words.indexOf("e", start + 1); } System.out.println("counter " + counter);
  16. You typed the class attribute incorrectly. You have <h1 class="message-texst"> but the code is looking for querySelector(".message-text")
  17. You have to delimit the table name with `backticks` instead of 'quotation marks'
  18. Most likely your code is running before the page has finished loading which means the element hasn't been created yet. You have to wait until the document has finished loading, which can be done with the DOMContentLoaded event. window.addEventListener("DOMContentLoaded", () => { var pane = document.getElementsByClassName("timeformat")[0]; alert (pane); });
  19. I'm not subscribed to the New York Times, so I can't see the articles. You can start by testing different libraries to see which ones are best suited for your project. Most likely none of them will be perfect but they should be a good starting point. After you have a library you will most likely need to write some additional code yourself or hire someone to do it. There's a tradeoff between ease-of-use and specialization. If you're satisfied with how a library works out of the box you can just use it as it is. If you want code specialized for your exact use case then you'll need somebody with a minimum level of programming skills. New York Times is a very large company, I would imagine that they've paid developers to code things exactly to their specifications.
  20. <form> is very well supported on all browsers. I'm not sure who maintains caniuse.com. I prefer to check MDN for compatibility: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#browser_compatibility
  21. That's right, it's called parallax. For advanced parallax you need Javascript. The code for parallax can be pretty difficult to build, but this is so commonly used that many people have already written the code and made it open for public use. You can download and use parallax libraries on your website: https://www.google.com/search?client=firefox-b-d&q=js+parallax+library
  22. Tables have the property that they will never shrink smaller than the content within them. If the content doesn't fit then you will have to remove some of the content or reduce the text size. Another option is to put the table inside a box with a scrollbar and let the user scroll horizontally on mobile devices.
  23. You can't have formatting in an alert() box. For the min() function to work you need to prefix it with Math. let size = Mahth.min(window.innerWidth, window.innerHeight); If code isn't working, you should check the developer tools for error messages which can help you figure out where the problem is. In most browsers, pressing F12 on the keyboard will open the developer tools.
  24. You need a <meta> viewport tag in order for the responsive CSS to work properly. Details about this can be found here: https://www.w3schools.com/css/css_rwd_viewport.asp
×
×
  • Create New...