<div id="box" style="height:800px; width: 400px;"></div> then I run the same js and I'm getting:
<div id="box" style="height: 800px; width: 400px; background-image: url (imageSrc); background-repeat: repeat;"></div> On Feb 22, 10:18 pm, batman42ca <[email protected]> wrote: > The reason you don't see the image in the div is because the div has > no size. Use css width, height to make the div big enough for your > background image if you want to see it. > > On Feb 22, 3:05 pm, negative <[email protected]> wrote: > > > js: > > > $$('img.theonly').each(function(el){ > > > var imageSrc = (el.getProperty('src')); > > > alert(imageSrc); > > > $('box').setStyles({ > > 'background-image' : > > 'url(imageSrc)', > > 'background-repeat' : > > 'repeat', > > }); > > }); > > > html: > > > <img class="theonly" src="272216.jpg" alt="image"> > > <div id="box"></div> > > > I'm getting image source file in alert box correct, but I cant figure > > out how to put it as a background on another div. > > Unfortunately it doesn't work the way I'm doing it.. Is there other > > way to make it happen?
