Recent Notes

Displaying keyword search results 1 - 10
Created by James on September 20, 2012 15:08:15    Last update: September 21, 2012 11:55:58
The idea is simple: duplicate the input field and position one on top of the other. The top one will take the input, while the bottom one will serve the placeholder. The top one will have a transparent background so the value of the placeholder field will show through. The placeholder field is disabled so that it's value is not submitted with the form. Here's the code: (function($) { $.fn.placeholder = function(... But in practice, it's tricky. Notice that I used 'background-color': 'rgba(255, 255, 255, 0)' for the background transparency. This is because 'background-color': 'transparent' does not work for IE9. Even though the input is on top of the placeholder, the placeholder always gets the event when you click on the field. That might be...
Created by Captain on November 22, 2010 04:34:37    Last update: July 22, 2012 20:36:26
HDTV modeline example: 1920x1080 148.5 1920 2008 2052 2200 1080 1084 1088... MythTV modeline database: http://www.mythtv.org/wiki/Modeline_Database <!DOCTYPE html> <html> <head> <style ... Reference: Custom Resolutions on Intel Graphics
Created by magnum on September 11, 2011 19:46:09    Last update: September 11, 2011 19:46:09
A pair of C functions convert between an Internet address and a string (ASCII): #include <arpa/inet.h> /* * Returns a poin... However , these functions do not support IPv6. The new pair is: #include <arpa/inet.h> /* Convert a Internet ad... Examples: #include <sys/socket.h> #include <netinet/in.h>...
Created by James on May 01, 2011 21:57:33    Last update: May 01, 2011 21:57:33
Both visibility:hidden and display:none hides an element in the DOM. But elements with visibility:hidden still takes up space, while display:none does not. Example (click the divs to hide or show): <!doctype html> <html> <head> <style t...
Created by James on May 01, 2011 21:40:35    Last update: May 01, 2011 21:47:18
It's a shame that double click events are always accompanied by click events in JavaScript. When you double click on an element, JavaScript fires two click events followed by one double click event. So if you attach both click and double click event handlers to the same element, both event handlers will be called when you double click. This is a utility function to alleviate the problem somewhat: <!doctype html> <html> <head> <script ... Note that there's still a possibility that both clicks and double clicks fired at the same time. This is because the timer used above may not be identical to the double click timer configured at the OS level. It's impossible to fix this problem in application code since each user may...
Created by James on March 29, 2011 11:37:53    Last update: March 29, 2011 11:37:53
The test page below reports the column and row indexes of the table cell you clicked. <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on March 29, 2011 11:28:33    Last update: March 29, 2011 11:30:12
The test page below shows how to count the number of columns for a given table row with jQuery: $('table tr:eq('+row+') td').length <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on March 29, 2011 11:25:35    Last update: March 29, 2011 11:25:35
With jQuery, it is pretty easy to access a table cell: just use the $('table tr:eq('+row+') td:eq('+column+')') selector. Below is a test page: <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on March 13, 2011 13:44:37    Last update: March 21, 2011 11:30:55
This is a jQuery input control that lets you enter any number of input rows of name and value pairs. <!DOCTYPE html> <html> <head> <title>jQu...
Created by Dr. Xi on August 27, 2008 19:40:19    Last update: January 14, 2011 09:33:20
There's a limit to the number of characters a bookmarklet can contain. Browser Max chars Netscape > 2000 Firefox > 2000 Opera > 2000 IE 4 2084 IE 5 2084 IE 6 508 IE 6 SP 2 488 IE 7 ~2084 IE 8 ~2200-2300 I tried it in the IE6 browser. The following code (573 characters) doesn't work as a bookmarklet. However, <a href="alert('Hi');">Short Bookmarklet</a> works. Actually, you don't have to save the link as a bookmark in order to test, just click the link, nothing happens if the length limit is exceeded. <a href='javascript:alert("var c = document.create... If the bookmarklet code is too long, you can save the JavaScript code on a server and use this function to bring it back to the page:...
Previous  1 2 3 Next