in reply to Display partial image

You probably could do it using stupid css tricks ... google it

Replies are listed 'Best First'.
Re^2: Display partial image
by ikegami (Patriarch) on May 16, 2010 at 06:08 UTC
    <div style="width: 20px; height: 20px; overflow: hidden"> <img src="http://promote.pair.com/i/pair-banner-current.gif"> </div>

    Catch 1: The image must be in a block element.
    Catch 2: The whole image is still downloaded.

      Thanks, I tried a couple of CSS tricks but not "overflow: hidden".

      Still, I'm not getting the desired because the entire width of the image is displayed.

      I'm trying to display the image in parts to show a game's progress. Imagine the image is sliced into neat pieces of 10 px by 10px. So if the game is at stage 1, the first 10px x 10px is displayed, starting from x=0 and y=0. At stage 2, the next (moving rightward first), the next 10px by 10px is displayed to show the progress.

      Any more help or pointers will be appreciated :)

        Still, I'm not getting the desired because the entire width of the image is displayed.

        Your browser apparently disregards the width for div!? You could try floating it or using something other than div (such as a table).

        At stage 2, the next (moving rightward first), the next 10px by 10px is displayed to show the progress.

        What does this have to do with Perl?

        Try googling for "CSS sprites", which is just a fancy term for making (clever) use of the CSS background property.

      But thats not google