Today I came across a weird bug on a client's wordpress site that broke Visual Composer. The Javascript console was reporting a a.poplight[href^=#] syntax err which seemed to indicate that popups were not working. Indeed, there was a section of the page with tabs that showed...
I recently created a form where one of the questions was asking for a specific code (specifically, a NAICS code). The problem was that there are almost 20,000 codes to choose from, so it was not practical to use a pulldown. I hit upon the...
Posted at 11:09h
in
HTML5,
jQuery,
Video
I needed to have an HTML5 video with a clickable poster frame. The first issue was that Safari would preload the movie, removing the poster frame after a few seconds. I fixed that by setting preload="none":
<div id="promovid">
<video id="video" controls="controls" poster="video-poster.jpg" preload="none" width="640" height="480">
...
A simple script to detect when a checkbox is clicked. What you do with once you've detected the click is up to you.
<html>
<head>
<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1.3.2");
google.setOnLoadCallback(function() {
$('#agree').click( function() {
if($(this).attr('checked')){
...
I was trying to add a small delay into my form submission like so:
<form ...
Posted at 11:13h
in
Google,
jQuery,
Programming
Here is what I do to avoid the dreaded "element.dispatchEvent is not a function" error. I load jQuery first, Prototype second, and then I use jQuery( ) instead of $( ) for all my jQuery calls.
<!-- Set up jQuery and prototype together ...
Posted at 17:19h
in
jQuery
IE6's well known margin problems can be solved many ways, such as using CSS that only IE6 will read.
I like to use CSS and jQuery as follows:
CSS:
#wrapper
 {
 margin: 0 auto;
 width: 800px;
 ...