Create a div with class name gotop and Simply Copy paste the jquery code in betweenfor getting a scroll top functionality in a webpage. <div class=’gotop’>Scroll To Top</div> Jquery Code jQuery(window).scroll(function(){ if(jQuery(this).scrollTop()>1){jQuery(‘.gotop’).css({bottom:”0px”})}else{jQuery(‘.gotop’).css({bottom:”-100px”})}});$(window).ready(function(){$(‘.gotop’).click(function(e){e.preventDefault();$(‘html,body’).animate({scrollTop:0},700).animate({scrollTop:60},300).animate({scrollTop:0},400)})})(jQuery); Searches related to Scroll to Top scroll to top jquery, javascript scroll to top, scroll to top bottom of the photos, scroll to…
Category: jQuery
Global Ajax Event Handlers
These following Global Ajax Events to be called at the time of initialization ,completion,success,send..etc. These type of events are triggered on each Ajax request, if the global property in jQuery.ajaxSetup() is true . ajaxComplete():This global event to be triggered when Ajax requests complete. .ajaxError(): This global event to be triggered when Ajax requests complete with…
Google Map does not center even after resize
You can solve google map re-size problem by triggering following event lastMapCenter=map.getCenter(); google.maps.event.trigger(map, ‘resize’); map.setCenter(lastMapCenter);
How to Check Expired Sessions using jQuery Ajax and PHP
We can achieve using the php and ajax.The following ajax call execute in every 10 seconds to check the status of session.If it expired the user redirected to seesionout page. Ajax call in every 10 seconds var check_current_session; function CheckForCurrentSession() { var strSession=”check_current_session=true”; jQuery.ajax({ type: “GET”, url: “check_current_session.php”, data: strSession, cache: false, success: function(result){…
How to get a click event inside of google maps infowindow
Jquery events foroogle maps infowindow elements are not work inside $(document).ready(function(){}) or script> tag because the elements not added to the dom when browser execute the jQuery. Solution for this problem is need to add one click listener for google maps infowindow. google.maps.event.addListener(infowindow, ‘domready’, function(e){ //Put your jQuery code here }); //example of infowindow jquery…