Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. Johna

    JavaScript JS Issue- 2nd lightbox not loading

    In JavaScript, the code will still run if semicolons omitted. Unless multiple statements are put onto the same line. Not sure if this is the problem, but it seems the minimum value your counter variable will ever be is 1. Note that in JavaScript (and most programming languages), array indexes...
  2. Johna

    Answered Replace very large jS if/elseif/else to show/hide many divs?

    Assuming each variable vehicleYear_[year] is an element with an ID like this vehicleYear_[year], and they all have the class name vehicle, you could do something like this: vehicleYearSelect.addEventListener("change", function() { const selectedVehicleYear =...
  3. Johna

    JavaScript PDF JS to calculate time difference in hours and minutes

    This is not unexpected when copying and pasting code generated by AI. With the information you've provided, it's impossible for me to tell what the problem is. Do you know why it's not working? Are there any errors in the console? I assume this isn't the complete code. As far as I know, there's...
  4. Johna

    More issues- positioning of arrows around gallery

    That probably means the container element is taking up the width of the entire page. You could either set a defined width for the container, maybe something like 300px, since that seems to be the width of your images, or you could also set the width to fit-content so that the element only takes...
  5. Johna

    JavaScript Click on any of the blue video buttons.

    Hi there. None of the target elements have a child with the class my-footer, so modal.querySelector(".my-footer") is always null. Perhaps you meant to do document.querySelector(".my-footer")?
  6. Johna

    More issues- positioning of arrows around gallery

    Although you can use float to position the arrows, I wouldn't recommend using that. I would apply relative positioning to the container element, and then use absolute positioning for the arrows and define their distance from the edges. When using absolute positioning, the position of the arrows...
  7. Johna

    After .exitD is clicked, which should be hidden?

    Are you asking for advice on which element to hide? That depends entirely on what content you want to hide. I take it you've already decided on hiding the element with the outer-containerA class?
  8. Johna

    After .exitD is clicked, which should be hidden?

    According to the code you've provided, nothing will happen then that element is clicked. Am I missing something?
  9. Johna

    hamburger wont work

    Hi there, The first thing to do when code is not working is to check the console. You would've seen that there are lots of errors. The JavaScript in the script tag after that hamburger button is not valid. You can't put HTML inside script tags.
  10. Johna

    JavaScript How do I break this line into 2 lines?

    I'm not sure what you mean by other ways of writing that line. Create an array of strings and join it? const radioStations = [{ src: [ "https://stream.synthwaveradio.eu/listen/", "synthwaveradio.eu/radio.mp3" ].join(""), title: "Synthwave Radio" }];
  11. Johna

    JavaScript How do I break this line into 2 lines?

    If you're asking how to break a string into 2 lines, then you can use the escape character (\) at each line break: { src: "https://stream.synthwaveradio.eu\ /listen/synthwaveradio.eu/radio.mp3", title: "Synthwave Radio" } Note that any indentation will be included in the string as whitespaces.
  12. Johna

    Hi all- trying to work out an image gallery. Code below.

    Hi there. var, let and const are just keywords used to define variable/constants (variables whose value can't be changed). Although you should generally use const when you don't want a value to change, and let when the value can change, it doesn't (usually) change the outcome of your code, and...
  13. Johna

    JavaScript Trying to have the X button work

    Could you walk me through what is supposed to happen in the JavaScript when the exit button is clicked, and when this function is supposed to be called?
  14. Johna

    JavaScript JS to reveal images in same place

    That should work. Function names in JavaScript are case-sensitive, in the js you've defined it as ChangeImage, but in the html it's changeimage.
  15. Johna

    JavaScript Trying to have the X button work

    The exit player button seems to be working in both of the code's you provided. Are the certain steps I should follow to reproduce the issue?
  16. Johna

    JavaScript Trying to have the X button work

    If it's working in the working code that you linked, then I'm not sure I understand what you're asking.
  17. Johna

    JavaScript Trying to have the X button work

    Hi there, can you explain what your current problem is, and what you're trying to achieve?
  18. Johna

    I create a Factor Calculator Tool for Factoring in HTML. Please Help with this

    Knew there had to be simpler way to do it. My code seemed too complicated 😅
  19. Johna

    JavaScript How to set, and then update a Datetime updated field?

    Hey there, You've defined the date variable at the beginning of the JS file. This value is defined once and never changes. To solve this, you can update the date variable each time the getFormattedDateTime() function is called. This can be achieved by removing the date parameter and placing...
  20. Johna

    I create a Factor Calculator Tool for Factoring in HTML. Please Help with this

    Hey there, Your code for the prime factors is checking the factors array for any numbers that are prime numbers and pushing it to a new array primeFactors. This is correct, because the prime factors for the number 24 are 2 and 3. Prime factorization, however, is the multiplication of a number's...
Back
Top Bottom