Skip to content

Instantly share code, notes, and snippets.

View abhishek-9ithub's full-sized avatar

Abhishek Mishra abhishek-9ithub

  • India
View GitHub Profile
@abhishek-9ithub
abhishek-9ithub / horizontalTableStickyScroller.js
Created November 25, 2017 09:13
horizontal-sticky-table-scrollbar
$(document).ready(function() {
$('input').attr('maxlength', '50');
var scrollbar = $('<div id="fixed-scrollbar"><div></div></div>').appendTo($(document.body));
scrollbar.hide().css({
overflowX: 'auto',
position: 'fixed',
width: '100%',
bottom: 0
});
var fakecontent = scrollbar.find('div');
@abhishek-9ithub
abhishek-9ithub / checkone.js
Created November 25, 2017 09:17
checkbox check one at a time
$(function(){
$(':checkbox').on('change',function(){
var th = $(this), name = th.prop('name');
if(th.is(':checked')){
$(':checkbox[name="' + name + '"]').not($(this)).prop('checked',false);
}
});
});
@abhishek-9ithub
abhishek-9ithub / removefakepath.js
Created November 25, 2017 09:22
remove fake path of file upload value
fileValueAfterChange = fileValueAfterChange.substring(fileValueAfterChange.lastIndexOf("\\") + 1, fileValueAfterChange.length);
@abhishek-9ithub
abhishek-9ithub / dtSortingClasses.js
Created November 25, 2017 09:24
place custom sorting classes on table
$(function(){
var asc = false;
$('.sortable th').click(function(){
if($(this).hasClass('sorting_asc')){
$(this).addClass('sorting_desc');
$(this).removeClass('sorting_asc');
}else{
$('.sortable th').each(function(){
@abhishek-9ithub
abhishek-9ithub / alphbeticalIndexing.html
Last active November 25, 2017 09:30
alphabetical indexing onscroll
<!DOCTYPE html>
<html lang="en">
<head>
<title>Alphabetical Indexing</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<style>
@abhishek-9ithub
abhishek-9ithub / mobile-number-verification.html
Created November 25, 2017 09:35
mobile number verification script
<!DOCTYPE html>
<head>
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
</head>
<body>
<input type="text" maxlength="10" class="mobileNum">
<a href="javascript:void(0)">Click ME</a>
<span class="error" style="color:red;">M</span>
</body>
@abhishek-9ithub
abhishek-9ithub / stickyHeader.js
Created November 25, 2017 09:40
sticky header on scroll
var sections = $('section')
, nav = $('nav')
, nav_height = nav.outerHeight();
$(window).on('scroll', function () {
var cur_pos = $(this).scrollTop();
sections.each(function() {
var top = $(this).offset().top - nav_height,
bottom = top + $(this).outerHeight();
@abhishek-9ithub
abhishek-9ithub / autoSearch.html
Created November 25, 2017 09:43
auto search on type
<!DOCTYPE html>
<html lang="en">
<head>
<title>Auto Search</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
@abhishek-9ithub
abhishek-9ithub / multi-level-menu.html
Created November 25, 2017 09:48
vertical multilevel menu
<!DOCTYPE html>
<html lang="en">
<head>
<title>Multilevel Menu</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
@abhishek-9ithub
abhishek-9ithub / multi-image-select-prev.html
Created November 25, 2017 09:55
multiple image select/preview
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
body {
padding: 0 20px;
text-align: center;
}