Centering dynamically a div on window resize using jQuery
The code below will centers a div horizontally and vertically on window resize: CSS .centeredDiv{ width: 400px; height: 400px; } Coffee script # This function gets the current window width and height...
View ArticleAdding simple Google Map with API 3 without jQuery plugin
Warning: We have developed a more complete solution about Google Map, check it here. Coffeescript This script will create a map inside the element with id specified in the variable id; the map will be...
View ArticleShowing Google Map inside a Bootstrap modal window
If you try to add a Google Map inside a Bootstrap modal window you will get some strange behaviors. This is because you need to trigger a resize event on the map when the div changes size (take a look...
View ArticleSending a form in a JSON object via AJAX to PHP server
Coffeescript # # * Function: Sends via AJAX the form data in a JSON object # sendForm = () -> formData = $("form").serializeObject() $.ajax url: "libs/process.php" type: "POST" data:...
View ArticleAdding reCaptcha validator to jQuery Validate with AJAX check and PHP
Here we will see how to integrate reCaptcha 1.0 with the famous jQuery Validate plugin. I assume that you already have a reCaptcha account (otherwise read the Step 1 from this post) because you will...
View ArticleHow to hide carousel controls on first and last items in Bootstrap 3
When you use Bootstrap carousel with wrap: false option you could want to hide control left button (with class .left) on first item and the right one (with class .right) on the last item....
View ArticleAdding Google Map with multiple markers without jQuery plugins
Some time ago we have seen how to add a simple Google Map with a single marker using the Google API 3. Very simple! Here is the code to display multiple markers. I advice you to use this script in...
View ArticleGet the Query String with Coffeescript as Associative Array
Below there is the Coffescript version of the function from this previous post, that returns an associative array containing field-value pairs from the query string: getQueryString = -> vars = [] #...
View ArticleCentering a div with CSS without negative margin or jQuery
You know, centering a div is always a pain in the ass, but now we have the cure, we have the pill, we have the suppository. The most note workaround was to use negative margin or using jQuery but with...
View Article