User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,598 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,865 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

image breaking

Join Date: Aug 2007
Posts: 128
Reputation: hacker9801 is on a distinguished road 
Rep Power: 2
Solved Threads: 13
hacker9801 hacker9801 is offline Offline
Junior Poster

image breaking

  #1  
Mar 30th, 2008
Hello.

I'm using JS/DOM to create a map in a <div>, named map, like this:
  1. var tile = document.createElement("IMG");
  2. tile.src = "tiles/" + node.getAttribute("type");
  3. tile.setAttribute("width", "32");
  4. tile.setAttribute("height", "32");
  5. tile.className = "brick";
  6. map.appendChild(tile);

It works, but the image breaks on a <br/>
(screenshot: http://i28.tinypic.com/6ynu3o.png)
the image is a 32x32 tile of grass.

It shouldn't have those breaks.

I've tried
  1. map.innerHTML = "<img src=\"tiles/grass.gif\" width=\"32\" height=\"32\" class=\"brick\">";
also, same thing.

Any ideas?
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 6:33 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC