[Javascript] text input field acting up

Paul Novitski paul at novitskisoftware.com
Sat Sep 4 01:25:36 CDT 2004


At 12:37 PM 9/3/2004, Innerlab wrote:
>Below is an example of image parameters that can be changed using javascript.
>
>var jsPath = "img/myimage.jpg"
>var jsHeight = 20
>var jsWidth = 200
>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 ?


To add a comment only slightly different from that of my learned 
colleagues: although a background image isn't given dimension in CSS, the 
element of which it's the background certainly can:

CSS:
         div
         {
                 background-image: url("frogs.jpg");
                 height: 100px;
                 width: 200px;
         }

which you can insert as an inline style:

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

Paul 





More information about the Javascript mailing list