Create a button so that on hover the background color fills the element from left, right or center side of the element.
Saturday, January 18, 2020
Friday, January 17, 2020
Shortcode in a WordPress Template
Shortcodes in WordPress are invoke for some kind of function to accomplish certain tasks. But what if you want to use a shortcode from within a template instead of with the content of a Post/Page?
You can invoke it with a special function:
You can invoke it with a special function:
Thursday, December 5, 2019
Get Table Name with Row Count from SQL Database
Select the database you want to filter the information about the row count and run following SQL Statement
SELECT
T.NAME AS 'TABLE NAME',
P.[ROWS] AS 'ROW COUNT'
FROM SYS.TABLES T
INNER JOIN SYS.PARTITIONS P ON T.OBJECT_ID=P.OBJECT_ID
This help me to know how many rows are there in table. Hope this will help you too.
SELECT
T.NAME AS 'TABLE NAME',
P.[ROWS] AS 'ROW COUNT'
FROM SYS.TABLES T
INNER JOIN SYS.PARTITIONS P ON T.OBJECT_ID=P.OBJECT_ID
This help me to know how many rows are there in table. Hope this will help you too.
Monday, November 18, 2019
Block or Disable Cut, Copy and Paste operation Using jQuery
It is required to block the cut, copy and paste operations on some of the textbox. For example, it will be better if we do not allow users to copy paste the data entered in Email and Confirm Email field in order to make the user to type themselves.
The below jQuery code will help us to do the same using preventDefault() method
The below jQuery code will help us to do the same using preventDefault() method
Move List Items Up and Down Using jQuery
Sometimes, we require moving/scrolling the list items in the select control up and down to sort manually. This little code snippet will help us to do that using jQuery library.
Thursday, November 14, 2019
Wednesday, October 23, 2019
Sorting by Key in An Array of object with Jquery
var data = [{ TagId: 1, TagName: "C#", },
{ TagId: 2, TagName: "Single Page Application", },
{ TagId: 3, TagName: "Visual Studio", },
{ TagId: 4, TagName: "Fakes", }]
var posts = [];
posts = sortByKeyDesc(data, "TagId");
function sortByKeyDesc(array, key) {
return array.sort(function (a, b) {
var x = a[key]; var y = b[key];
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
});
}
function sortByKeyAsc(array, key) {
return array.sort(function (a, b) {
var x = a[key]; var y = b[key];
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
}
{ TagId: 2, TagName: "Single Page Application", },
{ TagId: 3, TagName: "Visual Studio", },
{ TagId: 4, TagName: "Fakes", }]
var posts = [];
posts = sortByKeyDesc(data, "TagId");
function sortByKeyDesc(array, key) {
return array.sort(function (a, b) {
var x = a[key]; var y = b[key];
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
});
}
function sortByKeyAsc(array, key) {
return array.sort(function (a, b) {
var x = a[key]; var y = b[key];
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
}
Subscribe to:
Posts (Atom)