Awesome function to control youtube players in iframes
I’ve decided to convert the youtube slider I built for a client into a WP plugin. This function was a life-saver.
Read More
I’ve decided to convert the youtube slider I built for a client into a WP plugin. This function was a life-saver.
Read More
function nl2br( str, is_xhtml ) {
var breakTag = ( is_xhtml || typeof is_xhtml === "undefined" ) ? "<br />" : "<br>";
return ( str + "" ).replace( /([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1"+ breakTag +"$2" );
}
var items = {
"foo" : 123456,
"bar" : 789012,
"baz" : 345678,
"bat" : 901234
};
for(var index in items) {
document.write( index + " : " + items[index] + "<br />");
}
/*
returns:
foo : 123456
bar : 789012
baz : 345678
bat : 901234
*/
The design called for numbered items and the plugin that I was using creates unordered lists, here’s how I worked around it.
Read More
The Pears Property Group website involves pages of property listings that need to be sortable as well as filtered by area.
Read More
You can use javascript to getElementByTag or getElementById, but what about class?
Read More