window.scrollTo(0,0);
Category: jQuery
jQuery email validate function
jQuery email validate function function validEmail(emailText){ var pattern = /^([w-.]+@([w-]+.)+[w-]{2,4})?$/; if (pattern.test(emailText)) { return true; } else { return false; } }
Fancybox intilialization and content loading from a URL
<script type=”text/javascript”> jQuery(‘document’).ready(function() { jQuery(‘#delete’).click(function(e) { e.preventDefault(); var selected_ids = new Array(); jQuery(“input:checkbox:checked”).each(function(){ selected_ids.push(jQuery(this).val()); }); if (selected_ids.length > 0){ var oDeleteUrl = ‘<?php echo $this->baseUrl();?>/messages/delete/message_ids/’+selected_ids+’/place/inbox’; jQuery(“#delete”).fancybox({ ‘type’: ‘ajax’, ‘href’ : oDeleteUrl }); } }); }); </script>
get selected radio button value using jquery
Simply use the following code jQuery(‘.global_form_popup #submit’).click (function(e){ var chkdValue = jQuery(‘input[type=”radio”]:checked’).val(); alert(chkdValue); });
Bootstrap Tooltip intialization
Some times ajax loading is required for refresh content of a page. That time bootstarp tooltip is not work smoothly. That time we need to re-initialize the bootstrap tootip js using following code. After that tooltip will work like normal. <ul><li> <a href=”javascript:void(0);” rel=”smarttooltip” data-original-title=” Total hits of posts over last month “><?php echo $this->influences;…