Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Thursday, October 16, 2014

Dropdowns with autocomplete and synonyms

The Redesigned Country Selector:
'The technically correct term for this would be something like an “auto-complete text field with loose partial matching, synonyms and weighted results.”'

Thursday, May 22, 2014

jQuery vs document performance testing

Getting parts of a URL without using regex

As this response on StackOverflow says, have the browser do it for you:

var a = document.createElement('a');
a.href = 'http://www.example.com:123/foo/bar.html?fox=trot#foo';

['href','protocol','host','hostname','port','pathname','search','hash'].forEach(function(k) {
    console.log(k+':', a[k]);
});

/*//Output:
href: http://www.example.com:123/foo/bar.html?fox=trot#foo
protocol: http:
host: www.example.com:123
hostname: www.example.com
port: 123
pathname: /foo/bar.html
search: ?fox=trot
hash: #foo
*/

Or, with jQuery:

var lnk = $('<a href="http://www.example.com:123/foo/bar.html?fox=trot#foo" />')[0];
$.each(['href','protocol','host','hostname','port','pathname','search','hash'], function(idx, k) { 
  console.log(k+':', lnk[k]); 
});

Wednesday, August 21, 2013

jQuery and HTML5 storage

Aside from advising against using cookies to store html, this thread mentioned a jQuery plugin for HTML5 local storage:  jquery.html5storage.

Tuesday, March 12, 2013

Amazon's snappy submenus

Found this article on AListApart:
"Breaking Down Amazon's Mega Dropdown" by Ben Kamens, on how Amazon prevents its submenus from misfiring without using delays.

Friday, October 19, 2012

Script loading with headjs

From headjs.com:
"Load scripts like images. Use HTML5 and CSS3 safely. Target CSS for different screens, paths, states and browsers. Make it the only script in your HEAD. A concise solution to universal issues."

Monday, April 30, 2012

jQuery delay anything other than jQuery's effect functions

Stefan Siebel says here:
"Taking a closer look at the delay function showed me that only functions that are queued in jQuery’s default 'fx' queue are delayed by a delay-call like the one [here]. If you want to delay e.g. the trigger function you either need to queue it in the fx-queue or in a separate queue."

Friday, April 20, 2012

jQuery fadeIn and IE7-8 opacity

FadeIn on an absolutely positioned div with opacity=80 wasn't working on IE7-8.  Found the solution on stackoverflow:  set filter on the element before calling fadeIn.  For example:

$("#testdiv").css('filter', 'alpha(opacity=80)').fadeIn();

Friday, April 13, 2012

Courses at Tuts+

Courses at Tuts+ cover various topics, including html & css, html5 & css3, jquery, photoshop, web design, photography.