[Javascript] text input field acting up

Innerlab innerlab at hotmail.com
Sat Sep 4 10:25:50 CDT 2004


> > document.write('<img src="'+jsPath +'" width="'+jsHeight +'" height="+jsWidth +" />');
> > Now, how can I change such parameters when the image it's used as a background
> > Any ideas?

Hassan:

> 1/ it'd be good to start a new thread (with a relevant title) when
>  you change the subject

I know (shame). I just replied to an older post,  but I forgot to rewrite the subject line.

> 2/ the CSS spec is your friend; it shows the standard properties
>     available through the DOM -- <http://www.w3.org/TR/CSS21/>;
>     in this case, background images don't have a height and width
>     property, if you were looking for those specifically

Yes, that feature would have been nice to have...

Flavio:

>document.write('div.mydiv {background-image:url('+jsPath +');}');

Yes, the background URL in my code is dynamic through JavaScript, but the height and width of that image cannot be
specified. However, the container block (<div> in this case) can force that image to change dimension.

Like Paul wrote:

>  <div style="background-image: url('frogs.jpg'); height: 100px; width: 200px;">        </div>

The problem here is that my image has to be repeated along X, and it's height is dynamic.
It seems to me that specific div height doesn't work when the bkg. image is repeated. The div changes but the background stays at
the original image height.  I dunno....

I just joined a CSS list, because the solution to my problem lies on those <div> parameters, but so far it seems that I cannot
get the results I want.... Thanks for the replies, guys






More information about the Javascript mailing list