Tag: jQuery
Misc
Here is a method to make div or any other HTML element/tag scroll down to the bottom on a page load. The script uses the jQuery library. jQuery Code / Logic Used $(window).on(‘load’, function(){ sh = $(“#element”)[0].scrollHeight;...
Misc
I think this function is very important and included by almost all websites nowadays with medium to long page lengths. As a user, it feels very tedious to scroll up to the top of websites once we have scrolled down to the bottom of a long page. The function is written...
Misc
http://ip-api.com/json $(document).ready(function(){ $.getJSON(“http://ip-api.com/json”, function (data) { var country = data.country; alert(country); }); }); Get the location, city, country and other information related to your IP address with this free...
Misc
Just place this code anywhere after including jQuery library. This helps the user scroll to the ‘element’ id in href=”#element”. $(function () { /* Slide to # location with animation */ $(document).on(‘click’,...
Misc
How to prevent form from submission if user has not gone through Google ReCapcha ?jQuery(document).ready(function(j){ jQ(‘#formid’).submit(function(e) { var recaptcha = j(“#g-recaptcha-response”).val(); if ( recaptcha === “” )...