Profile cover photo
Profile photo
Tyler Vigeant
69 followers
69 followers
About
Tyler's posts

Post has attachment
Tunnel Falls
Photo

Post has attachment
Wahclella Falls, Oregon.
Photo

Post has attachment
From the "Tom" peak of Tom, Dick and Harry Mountain in Oregon.
Photo

Post has attachment
Otter Rock, 9/14/14
Photo

Post has shared content

Post has shared content
Today in Geek History: The Man of a Thousand Voices, Mel Blanc, was born in 1908. 105 years later, people across the world still ask, "What's up, Doc?"

Post has shared content
I don't like caramel, but I'm excited about this. Why?
The Caramel Ribbon Crunch Frappuccino. Four kinds of caramel. All kinds of awesome.
Photo

Post has attachment
I've been looking for a way to pull off the pre-selector for a while, and the second half of this article tells me just what I need to know!

Post has attachment
Many of the websites that I build require delayed events for things like hover-intent, polling, or debouncing. Instead of constantly approaching this on a case by case basis, I decided to tackle the problem in a highly reusable way, and ended up creating a jQuery plug-in.

Originally inspired by +Paul Irish's debounce plug-in, my plug-in supplements jQuery.on() allowing entire events to be delayed and debounced.

Researching this eventually lead me to +Ben Alman's jQuery.doTimeout() plugin. The problem with that plug-in was the learning curve that some developers had when using multiple timeouts, and when canceling timeouts. It also didn't seem to have any built-in way to remove the delay of the code execution without rebinding the event handler. (Something that would require duplicate code when using anonymous functions.)

As such, I decided to give my plug-in near identical syntax to jQuery's native jQuery.on() method, (which should make it very easy for developers to pick up.) I also added helpful method to rebind the event handler without the code execution delay. Existing code can be easily augmented to use delayed event handlers simply by changing the method name.

Check it out, and leave a comment if you have any questions or suggestions!

Web Developer Tip of the Day
The website that I've been working on for the last 2 months frequently uses a CSS technique for even column heights that uses padding, negative margins, and overflow:hidden on container elements. (http://www.ejeliot.com/blog/61) I also frequently assign overflow:auto to container elements so that they will more intelligently stretch as needed when the container element includes floated content.

This technique has been working great, until I started running into problems combining it with "Chosen", the fantastic drop-down replacement from Harvest. (http://harvesthq.github.com/chosen/)

The problem comes when Chosen creates a relatively positioned div tag which contains the options for the drop-down. If the Chosen drop-down is near the bottom of the container element it triggers scroll bars.

One trick that I figured out which solves this problem involves setting the height of the container element to the scrollable height of the itself. Which can be done like so:

document.getElementById('MyContainer').style.height = document.getElementById('MyContainer').scrollHeight;

This can be done with jQuery like so:


$('#MyContainer').height( $('#MyContainer').get(0).scrollHeight );

This is a useful trick if you ever find yourself needing to know the height that a scrollable element has become (likely through dynamic changes to the DOM,) and is something that both .innerHeight() and .height() in jQuery won't tell you.
I hope that helps someone out there. Have a great Friday!
Wait while more posts are being loaded