www.webdeveloper.com
Results 1 to 2 of 2

Thread: Dynamically Increase the height of the image

  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Exclamation Dynamically Increase the height of the image

    I have a code which is something like this

    <body>

    <table width="auto" height="100%" border="0" style="background:url(images/s3_2_fade.jpg) blue no-repeat;">
    <tr>
    <td>
    Sample Data...<br/>
    Sample Data...<br/>
    </td>
    </tr>
    </table>
    </body>

    The image's height is 376px. So once the content goes after 376px, the blue bgcolor alternate takes over. But what i want is, once the content crosses the 376px height, the background image should dynamically stretch and not repeat.

    Please its urgent. Help on this

    If this is not possible please do tell me how to increase the height of image in <img> using DOM methods.
    Again this should increase when the image's original height becomes greater than 376px

  2. #2
    Join Date
    Sep 2009
    Posts
    146
    There is no way to increase the size of a background image (short of CSS 3)

    there is no good option for what your trying to do... ill the methods i have seen will give you problems elsewhere. this says it all:
    http://css-tricks.com/how-to-resizea...kground-image/

    the best i can think of is to surround the table with a div (position relative). then place an image (position absolute) and have it go behind the table. then with JS match the image height with the table height. You will hit z-index problems with IE but like i said, there are no easy options.

    -aPeg

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles