Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


denno020 last won the day on May 3 2019

denno020 had the most liked content!

Community Reputation

22 Good

About denno020

  • Rank
    Prolific Member
  • Birthday 02/22/1987

Profile Information

  • Gender
  • Location

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The issue you're running in to is one of timing. The fact that you can see the toastr at all is very surprising, and likely because there aren't any other actions being performed on click.. As soon as there are some actions being performed within the click handler, then the toastr likely won't ever be seen! Unless of course, we fix it! Essentially we need to tell the browser to stop processing the click event so the page refresh doesn't occur Something like this will get you going: <script type="text/javascript"> $(document).ready(function () { $('#add').click(functio
  2. I completely agreed with @requinix, this is a situation where jQuery excels, and will save you a lot of time and headache. It's definitely possible to do this with vanilla JS, but it's a lot more code. One suggestion I will make is to use a `<template>` element, which can contain the HTML that you will clone. This way you don't have to clone an existing HTML DOM node, which will contain user changes and would require you to go through each field and clear the values of the inputs/textarea before injecting it into the page as a new node. Check out the MDN docs for `template`, they ha
  3. The offending line that is only allowing you to search the first column is this one: td = tr[i].getElementsByTagName("td")[0]; The `[0]` portion of that statement means to literally get the first column only. An easy fix is to add a nested loop, that does essentially the same as the for loop for the `tr` element, but do it for `td`, provided `td` is assigned: td = tr[i].getElementsByTagName("td"); Simply move the if block inside that inner loop, and it should work (some variable names inside that second for loop will need to be updated) As for making this work with
  4. I have never used Audio previously, but looking at the docs, audio.load() will reload the file, which means you should be able to omit it here. Also, the event to listen for is "loadeddata", rather than "load".. See how those updates go
  5. You're going to want to make use of setTimeout. The syntax is as follows: setTimeout(function() { // Execute this code after the timeout of 1000ms }, 1000); Keep in mind that this function is asynchronous, which means $(document).ready(function(){ setTimeout(function() { intro('#hello', '#world'); }, 1000); setTimeout(function() { intro('#hi', '#all'); }, 1000); setTimeout(function() { intro('#hola', '#amigos'); }, 1000); }); Will execute all into functions after 1 second. This could be a solution: $(do
  6. Which colour are you trying to change? The `color`, which is the text colour, or the `background-color`? I can see the background colour of the button is `background-color: rgb(48, 133, 214)`, which is added as an inline style, using the `style` attribute. To overcome that, you're going to have to get more specific when writing your own style, and the only way to do that is to use `!important`: .swal2-confirm { background-color: purple !important; }
  7. First, to make your code easier to read, I suggest you write it like this: <script type="application/javascript"> (function($) { $(document).ready(function() { $(" .et_bloom_submit_subscription").click(function() { var $subscibeButton = $(this); // same as $('.et_bloom_submit_subscription') var $form = $subscibeButton.closest('.et_bloom_form_container'); var $firstName = $form.find('.et_bloom_subscribe_name input'); if ($firstName.attr('value') == '') { $firstName.addClass('et_bloom_warn_field'); return false; }
  8. A quick and slightly dirty way you could achieve this is by wrapping your checkbox groups in a single element (div for example) and wrapping your tables in a single element also (but not the same one). So it would be something like this: <div class="checkbox-groups"> <!-- All of your checkbox groups --> </div> <div class="tables"> <!-- All of your tables --> </div> Then, you can use jQuery's index() function to get the index of the group that contains the checkbox that is activated, and then find the corresponding nth-child() in your tables div. S
  9. The only way to get a value from JS to your PHP is to send a request from the JS to your server. This could either be through a form submission or an AJAX request PHP is run on the server, whereas JS is run on the client, essentially 2 completely different places that each have no idea about the other.
  10. There are issues with your code, no doubt, but what our friend above didn't mention is the reason you're getting the error is because you've got a semi colon at the end of line 8, even though you then try and concatenate another function call. Remove that semi colon and your code shouldn't complain. Whether it works as you expect it to is what you'll need to test next Denno
  11. Hi Stephie22, A Google for "Javascript carousel" turned up this, which looks quite nice: http://kenwheeler.github.io/slick/ Otherwise just run the same search and see what you can come up with, there will be a tonne of existing plugins/libraries etc
  12. Update: I have got back in touch with the hosting provider and am speaking to a different person now, and they're telling me that imagewebp isn't enabled and that I can't get it enabled because it's not supported on shared hosting. So seems there is nothing I can do about it. Thanks anyway
  13. Thanks for the response. How would I check the version of GD that is installed? I did suspect this could be the problem, but I didn't realise they were installed separately, so I (apparently wrongly) assumed that it was inside PHP itself. Also, as I mentioned, when running phpinfo() on the production server, it lists webp in the following two sections: HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 $_SERVER['HTTP_ACCEPT'] text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Is this not relate
  14. I'm having a weird issue with the aforementioned function inside my site. Here is an excerpt of code: if ($extension == 'jpg' || $extension == 'jpeg') { $isSaved = imagejpeg($image, $filename, $imageQuality); } elseif ($extension == 'gif') { $isSaved = imagegif($image, $filename); } elseif ($extension == 'png') { if ($imageQuality >= 100) { $imageQuality = 0; } elseif ($imageQuality <= 0) { $imageQuality = 10; } else { $imageQuality = round((100 - $imageQuality) / 10); } $isSaved = imagepng($image, $filename, intval($
  15. In the interest of completeness, something I didn't add to the jsFiddle is to break the loop(s) once you've found the data you want. Don't need to waste time looping through the rest of the data if you already have your translation value
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.