Skip to content
Archive of posts tagged DOM Images

Automatically Wiring Up XHTML Element Events On Page Load With jQuery

Many Web developers find themselves in an environment where the design of a Web page is handled by a graphic designer or junior programmer, either as part of their team or from a subcontractor or the client himself.
Unfortunately, traditional HTML / XHTML requires most element events handlers — onmouseover, onclick, onfocus, etc. — to be [...]

JavaScript Function Arguments: They’re An Array And You Can Treat Them As Such

One of the nicest features of JavaScript is the ability to treat function arguments as an array. We all know how to write a function that takes a known number of arguments:

function foo(bar) {
alert(bar);
}
 
function getArea(shape, measure, unit) {
var output = ‘The area of a ‘ + measure + ‘ ‘ + unit + ‘ ‘ [...]

The Simplest Ways To Do Image Rollover Effects: JavaScript And CSS-Only

A common question on Yahoo! Answers is how to do image rollover effects simply.
There are two ways to do so: With JavaScript, and via CSS alone. Of the two, I prefer the JavaScript method, as it doesn’t require marking up your code too much; but the CSS method is fine, too, and takes away [...]

Using jQuery To Show A Form Over A Reduced-Opacity Image

It’s an awful thing, waiting for a question at Yahoo! Answers that would be fun to discuss as a blog entry. There is an awful lot of chaff to be sorted before one finds such wheat, and even then, sometimes the supposed grains turn out to be mouse turds.
Consider the following:
How would this be done? [...]

Showing A Larger Image From A Thumbnail OnClick Via JavaScript / DOM Revisited

Recently asked on Yahoo! Answers:
Showing a Larger picture from a Thumbnail – How to include the Title?
I have followed the steps from http://www.dougv.com/blog/2007/02/07/sho…
using the iFrame version, but cannot get the image on click to display the title used in the img tag.
i.e
Using the Addendum: information posted the title that gets displayed is ‘image_02.jpg’ when [...]

An Image-Based ‘Checkbox’ Via JavaScript / DOM

Recently asked on Yahoo! Answers:
Use a custom image for check boxes???? Please help, I”m going insane over such a simple thing.?
Heya.
Don’t worry, I’m not really going insane – it’s just kind of frustrating because such a simple little thing is giving me trouble. I want to use custom images for check boxes on a HTML [...]