Image Resize on Mouse Over via css

I have been looking for ways and means to resize images on mouse over. The reason? If you look at this post, you will notice that the numbers of interest are not visible at all on the image at the current resolution. However if the images are displayed at full-size, it overflows the container and makes the entire page look quite ugly.

I found quite a few solutions, however none served my purpose, since almost all of them used javascript and that broke my XHTML compliance. So I wrote this fully css hack. It resizes the image on hover. The code as such is VERY simple. I just defined a class called img_resize.

.img_resize{
width:50%;
}

.img_resize:hover{
width: 200%;
}

That’s about it. I just use this class, when I define my image tags,. Works in all browsers but (guess which one) yeah IE. Well, I don’t care too much about that. If you are an IE user and want to see these images the right size, well you can open them in a new window, or even better move to a decent browser.

EDIT: Anil pointed out that the css would work much better if I changed the settings for the hover image to auto. I agree, so I guess the updated css should be

.img_resize:hover{
width: auto;
}

Here normally the image takes the width specified in the img tag. On hover, the image is shown at the true size, which is the desired behavior

EDIT 2:
Well I got this fixed for IE too. But I hate the fact that I need to put in hacks for a browser. Imagine the amount of pain guys at google or any other web based company need to go through to make sure their stuff works with all the stupid browser quirks. Anyway the hack is based on the post by Peter Nederlof. For detaiils please visit the link. I shall not pretend to know how the hack works. Anyway all you need to do is download this htc file and put it somewhere where your page can access it. Now add these lines in the header of your html

<!–[if IE]>
<style type=”text/css” media=”screen”>
body{behavior:url(https://ierr.dev/Media/Data/csshover.htc);
}
</style>
<![endif]–>

If you have a doubt, have a look at the source of the current page. Anyway thats about it. The hover link now works in IE too.
Here is a test image using the above mentioned hover

Sample image

Technorati tags:  ,  

Love Linux? Let’s see you install it on a badger

So you love Linux and swear by it. Then let’s see you install it on a dead badger. Yeah, you heard me right, a dead badger. Well turns out someone thought of it and posted detailed instructions for the same. Amazing!
Quoting from the website …
Minimum Installation Requirements:

  • one (1) pocketknife
  • one (1) screwdriver, flathead, to install Duppy card (see item 4. below)
  • computer with:
    • CD drive
    • USB, Ethernet, or a free slot for wireless networking card
    • Telnet or SSH client installed
    • cyberspiritual controller program such as FleshGolem (Mac OS X and Linux), Phranken (Windows 98, ME, 2000), or ItzaLive (Mac OS 8.1-9.x and Amiga)
  • one (1) Duppy card (available in CardBus and PCI models) or SpiritInTheSky external adapter (available in ethernet and USB models)
  • VüDü Linux (available from Twisted Faces Software)
  • minimum 3′ x 3′ (1m x 1m) fireproof surface, in secure, ventilated area
  • privacy
  • one (1) dead badger, good condition

Technorati tags:  ,  ,  

Powerbook rated #1 Gadget of all time :D

Guess what!! MobilePCMag has rated the powerbook as the #1 Gadget of all time. They have rated 100 gadgets and the powerbooks stood first ;). Well of course I should not fail to mention that the powerbook in question here is Apple’s Powerbook 100 and not the latest generation that I own. Here is the reasoning given on the website

Never mind the Apple versus PC debate: Until Apple unveiled this 5.1-pound machine, most “portable” computers were curiosities for technophiles with superior upper-body strength. But the PowerBook 100’s greatest and most lasting innovation was to move the keyboard toward the screen, leaving natural wrist rests up front, as well as providing an obvious place for a trackball. It seems like the natural layout now, but that’s because the entire industry aped Apple within months. The first PowerBooks captured an astounding 40 percent of the market, but more important, they turned notebook computers into mainstream products and ushered in the era of mobile computing that we’re still living in today.

Wow, imagine a single portable capturing 40% of the market. Innovation, thats the name of the game. Kudos Apple. Even Apple has it share of problems, for eg they will not replace a laptop with bad pixels unless there are 10 or more of them. I find that totally absurd. But I am quite happy with them for their products both hardware and software. Lets see what the future hold for them

Cross browser compatibility?

Well you might have heard about how MSN had doctored its site just so it didn’t work in Opera. Well I have no idea why they did that only to Opera and not to any other browser. Anyhow yesterday I paid my taxes online and got a nice refund back (yippie!). Anyway I used this website, exTaxreturn. Now the odd thing is that they seem to have differing PRICE SCHEMES depending upon the browser you use. This is so so very odd. Here are screenshots taken from three different browsers at around the same time today.

Thanks Anil

On Windows

ezTaxreturns.com on Windows

On Firefox on Mac

ezTaxreturns.com on Firefox on a Mac

On Safari on Mac

ezTaxreturns.com on Safari on a Mac

Check out the range of prices!!

Online mapping, never trust them too much

I was browsing the net looking for some good websites. Anil had linked to this site, thedailywtf. Pretty cool site, ithas what the author calls wtf’s in code. Anyway so there was this link out there where a user had queried msn for the quickest and the shortest route between two places in Norway. Man the results were astounding. Please do go here and check it out for yourself. Anyway for ypur benefit, here are the results. The first image is for the shortest route and the second is for the quickest. :)). I will never believe in these maps ever again


Shortest route
The Shortest route

Quickest route
The Quickest route

Rendering video in C#

Today I was trying to render video using bitmaps I create in memory. Now I don’t know why but if I render two videos simultaneously, my processor utilization went sky high to 90%. Now keep in my mind I code on a 3.4 GHz hyperthreaded P4, so there is no dearth of processing power out there. I tried several things, but the lowest I could bring the CPU utilization to was 40% and this was in the release mode. I don’t get it. Am I doing something wrong here? If any of you .NET gurus are reading this blog (I am sure you aren’t who reads my blog anyway), please suggest something

Yippie!! My name is now in the NYT

Yup. I donated some money to the Mozilla Foundation so they could place an ad for Firefox in the New York Times. So today the ad came out, amazing piece of work. God knows how those guys managed to render that ad. Thanks to Anil I managed to get a copy of the paper and found my name on it. It is arranged alphabatically by the last name. Here is my name in the paper .. pretty sweet heh ;).. next up I am gonna buy a mozilla firefox t-shirt. Since I haven’t been able to code for them, this is the last I can do

My name in the NYT

My name yippie

The Full ad

The entire ad, trust me it is huge

Russell Peters

A few days back my roommates showed me a video. It was a 45 minute show by this Indian called Russell Peters. He is an Indian and a stand-up comedian. This is what a website had to say about Russell

Gemini award winning Canadian comic Russell Peters is known for a cheeky brand of comedy, that is rude and laddishness without being offensive to the females in the audience. With Asian roots, Russell explores attitudes towards race in a way that is fresh, surprising and hard-hitting. At times controversial, Russell combines his observations with a likeable stage persona and a cheeky grin.

I warn you, this show is not for
1. People who cannot take jokes about race
2. People who don’t have 45 minutes to spare.

But if you don’t fall into either category, you will surely enjoy this.

EDIT: I had to take down these videos since someone complained that this was copyrighted material.