Archive for August, 2007

eBay Vendor Review: sangbiz

User Name: sangbiz
Product Purchased: Motorola RAZR V3 OEM Front Outside LCD Lens Screen

Product As Advertised: Yes
Shipped Quickly: Yes
Customer Service: Excellent

You knew it was just a matter of time before I’d be writing about a cell phone-related purchase on eBay. About a week ago, I cracked the glass on the front of my Motorola Razr V3. So I had pretty much figured I would be out another $120 to purchase a new phone.

Then I discovered, after a quick Web search, that the front lens on the V3 is just a piece of flat, tinted glass adhered to the front via double-sided tape. So, off to eBay to find a replacement.

There were lots advertised for $1.99, but they were all located in Hong Kong — and I’ll be damned if I am going to give someone in Hong Kong my billing information, never mind waiting for the slow boat from China to get the replacement to me.

So I found sangbiz based out of Florida selling the replacement lens for $6, and $5 for shipping.

Read the rest of this entry »

An Open Letter To A Programming Noob

Recently received in my e-mail:

Hi There

Found your email on your blog via the contact me which is linked to on your [Yahoo! Answers] profile.

I was curious as to what languages you program in as I am keen to get into programming and wanted any advise or recomendations for books.

I have done quite a bit of visual basic 6 which I know is not OOP.

Would be good to either do vb 2005 or c++ or java

Thanks

Shane

My response to this e-mail follows.

Read the rest of this entry »

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 page.

The best way I can describe this is that I want a bright red flashing gif to be there by defualt, then for that to change to a green flashing gif when it’s clicked.

I don’t care if it’s done using a real checkbox, I don’t need it to actually work. I only need the picture to change when it’s clicked, and stay changed after that unless clicked again.

Apparently either it’s such a simple thing to do that no one has ever talked about it, or no one has ever needed to do it before and never given it any thought, because I’ve looked for help with this all afternoon and tried 6 different ideas of my own with no luck. I can write a fully functional & good looking page in notepad but not get a dumb little image to change when it’s clicked. Go figure.

Please help! Thank you :)

I’ve written about using JavaScript / Document Object Model (DOM) manipulation to change images onclick, onmouseover or via virtually any other event on many occasions. But it’s the idea of using an image as a checkbox that got me curious: Sure, we can change any image onclick, but can we also get the id attributes of all the checked items for use in form processing?

Yes, we can! So we’ll tackle this question in three parts: Example 1 will simply change images on click; Example 2 will let us find out which images are “checked,” via a JavaScript array; and Example 3 will assign the checked images to regular, old HTML check boxes, so you can process the form as you would via any HTML postback.

As always, I will provide links to working demos at the end of each example.

Read the rest of this entry »

Swapping An Image From A Non-Animated GIF To An Animated GIF Via JavaScript / DOM

Recently asked on Yahoo! Answers:

I have created a .gif for a webpage how do I get it to animate only when the mouse pointer is on top of it?

I have created a .gif for a webpage how do I get it to animate only when the mouse pointer is on top of it?

Do you have a link to a page which can guide me here.

I have frontpage etc

This is fundamentally a mash-up of previous topics I have posted on swapping images on mouseover. Basically, it’s three steps:

  • Create the animated GIF;
  • Create a second GIF, that is only the first frame of the animated GIF;
  • Put together some JavaScript and HTML that swaps the images on mouseover / mouseout.

Or, we could simply let JavaScript handle the animations, and just use a series of images in sequence. I’ll demonstrate both approaches. As always, a link to a functioning demo appears at the end of this entry.

Read the rest of this entry »