Skip to content

Instantly share code, notes, and snippets.

At the moment my jQuery code is producing some odd behavior.
Clicking on one button causes the filter to work fine, but you cannot click it off and display all of the posts as before.
Clicking on multiple buttons also works; sometimes clicking a button off will work, but this is not consistent,
sometimes it will need to be clicked multiple times before it works.
-----------------------------------------------------------------------------------------------------------------------
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script>
@andyf-7
andyf-7 / client side mail validation
Created May 3, 2015 10:31
jqeury Mail validation in client side
function ValidateEmail(email) {
var expr = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
return expr.test(email);
};
@andyf-7
andyf-7 / Table tr sorting ascending
Created May 3, 2015 10:52
Table all tr ascending wise sorting
$(document).ready(function() {
$('table tr').sort(function(a, b){
return $('td:eq(0)', a).text() > $('td:eq(0)', b).text()
}).appendTo('tbody');
} );
@andyf-7
andyf-7 / jquery like search on table
Created May 3, 2015 10:54
Search table in all td value on like match its only client side use js
function searchdata()
{
var values=$('#vardata').val();
$('#search_textdata').find('tr td a').each(function ()
{
@andyf-7
andyf-7 / Jqeury multi div scrol
Created May 3, 2015 10:58
J query Scroll bar detected and others div scrol
jQuery(
function($)
{
$('#thetable').bind('scroll', function()
{
var s = parseInt($(this).scrollTop()) ;
$('#right').scrollTop(s);
})
}
@andyf-7
andyf-7 / Jquery responsive window check
Created May 3, 2015 11:00
Client side window onresize for resposivewindow
function resposivewindow(){
// Get the dimensions of the viewport
var width = window.innerWidth ||
document.documentElement.clientWidth ||
document.body.clientWidth;
var height = window.innerHeight ||
document.documentElement.clientHeight ||
document.body.clientHeight;
if(width==1320){ $('.sumitselect').addClass('form-control');}
@andyf-7
andyf-7 / Jquery array push
Created May 3, 2015 11:02
Jquery array push
var GradeName=[];
$('input[name="GradeName[]"]').each(function(){
GradeName.push(this.value);
});
@andyf-7
andyf-7 / mouse click then this possition div show
Created May 3, 2015 11:04
mouse click then this position div show on jquery
$(document).on("click",".footer-container ul li span a",function(e){
$('#viewfooterdoplist').css( 'position', 'absolute' );
$('#viewfooterdoplist').css( 'top', e.pageY );
$('#viewfooterdoplist').css( 'left', e.pageX );
})
@andyf-7
andyf-7 / Div move left or right
Created May 3, 2015 11:06
jquery div move left or right
if(e=="moveleft")
{
var $current = $('#tsi'+shhetid).closest('li');
var $previous = $current.prev('li');
if($previous.length !== 0)
{
$current.insertBefore($previous);
}
return false;
}
@andyf-7
andyf-7 / check box checked
Created May 3, 2015 11:08
jquery check box checked
if($(".clschekbox").is(':checked')!=true)
{
alert("Please Select Checkbox");
}
else
{
var clientid =[];
$('input[name="clientid[]"]').each(function () {
if($(this).is(':checked')==true) {
clientid.push(this.value);