Jump to content

Ingolme

Moderator
  • Posts

    14,894
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. You probably would have to do the math yourself for each pixel and draw the result on a canvas. I don't think that would run fast enough to work on videos. There is nothing natively in Javascript or HTML that converts between RGB and HSL colors that I am aware of. To run algorithms on individual pixels, I would use getImageData() and putImageData() to do pixel manipulation.
  2. Unfortunately, I cannot allow you to link to your website here. Can you describe the issue and show the code which is causing it? I did not see any responsive issues on your website.
  3. backgroundColor needs a capitalized C. IDs are not permitted to begin with a number, but I think browsers might still work if you do that. I would recommend fixing the ID anyway.
  4. You're probably looking for the value of the element: var eingabe = document.getElementById('meininput').value;
  5. It's generally done with a server-side programming language. For personal sites, PHP works fine for that. In PHP, you would use the include() statement.
  6. Setting max-height with overflow would do it, as long as your element is a block type.
  7. There's no need to show the code that he wrote, it's the code that is on the tutorial page: https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp The topic is asking how to put two of them on the page at the same time without duplicating the Javascript. I've answered this one already. The problem can be solved by attaching events using Javascript instead of as an HTML attribute.
  8. Yes, it will prevent anybody from seeing the blocked paths, whether they're search engines or people.
  9. You can add a <meta> robots tag to the page telling search engines not to index the page. <meta name="robots" content="noindex nofollow">
  10. It is called as soon as that line of code is executed, which is whenever the file is included and as many times as the file has been included. It is not different than any other function call.
  11. As shown in this post, there isn't a good reason to use HTML attributes for events and they severely hinder code maintainability. In this scenario though, the global event variable wouldn't be needed since addEventListener passes it into the callback. I'd rewrite it like this: cTabButtons.forEach(tabButton => tabButton.addEventListener("click", function(e) { openCity(e, this.textContent); }));
  12. Your Javascript won't work because you're calling openCity() and assigning the return value of the function as the event handler, it seems you have little experience with using event listeners outside of HTML. Aside from that, using properties such as "onclick" for events is also a bad practice since it will overwrite any existing event listener on the element and can be overridden by other code written in the same way. This is why addEventListener() should be used to attach events. If you're going to use HTML attributes for event listeners, the only way to access information about the event is through the "event" variable, which is passed into the attribute along with "this". All browsers support it and have to continue supporting it as along as HTML attributes are being used for events.
  13. You should check the browser's Javascript console for errors. Most browsers let you see the console by pressing F12 on your keyboard. This will help you fix problems in the future. Right now, the error console would tell you that getElementsByID does not exist. The name of the method is getElementById. The "d" is lowercase and "Element" is not plural.
  14. If "event" actually is deprecated then by what means can you get information about the event inside the attribute? Personally, I think the bigger problem is using HTML attributes to attach Javascript events in the first place.
  15. Without the CSS, I can't reproduce the issue. There's no Javascript in the attached file either. You have some mistakes on this line of HTML which may cause some other, unrelated problems: <input type="radio" name="occupanc" value-"Part-time">Part-time<br>
  16. Since the major email clients do not support video, I imagine MailChimp is removing the code for it. I'm pretty sure audio will not work either. Mail clients are extremely primitive, they support text and images and little else. Even layout and styling options are limited.
  17. If you assign a jQuery result to a variable, you do not need the $() function to use it. This should work, though I haven't tested it so there might be a mistake somewhere. ( function( $ ) { var modal = $('#myModal'); var img = $('.myImg'); var modalImg = $('#img01'); var captionText = $("#caption"); img.click(function(){ modal.show(); modalImg.attr("src", $(this).attr("src")); captionText.html($(this).attr("alt")); }); var span = $(".close").first(); span.click(function(){ modal.hide(); }); } ( jQuery ) ); I do not see any good reason to convert Javascript to jQuery. jQuery is far less efficient and isn't natively built into browsers, requiring a download of an external file before it can run.
  18. The second condition only gets tested if the first one was false. Since 5 is actually greater than 2, it does not need to go on and test the second condition. If you want both conditions to be tested, you do not need the elif() statement. A second if() will do the job.
  19. A body selector should work fine. Something like this: body { border-top: 4px solid #3c4043; }
  20. Looking at the picture, my guess is that you should actually set it to "span 6" if you want each box to be half the width of the grid. If you are already using an ID selector in CSS on these elements, you will not be able to override it with a general selector like "body footer". ID selectors cannot be overridden except by other, more specific ID selectors.
  21. It's hard to guess what the problem could be without knowing that the HTML structure is. Do you have three footer elements or three elements wrapped by a footer?
  22. Preview images and text should only appear if the website has OpenGraph tags defined in the HTML
  23. That should work, but it could be made more efficient if you store the column values in a variable declared outside of the loop. Is there a reason you replaced in_array() with array_search()?
  24. You will have to loop through the second array for each element in the first array to compare their values. $found = false; foreach($_POST['services'] as $id) { foreach($serviceslist as $service) { if($service['serviceID'] == $id) { $found = true; break; } } if($found) break; } if(!$found) { echo json_encode('nosuchservice'); }
  25. Unfortunately, the website staff do not interact on the forums. You might be able to contact them at help@w3schools.com It looks like the material of the courses is the same as the related tutorials on the website. It says this on the HTML course page: https://courses.w3schools.com/courses/html The General forum is OK for questions that don't have a particular forum for the category.
×
×
  • Create New...