/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@apegJun 10.2010 — 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-resizeable-background-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
×

Success!

Help @varunvv spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...