[Javascript] Code optimization
Troy III Ajnej
trojani2000 at hotmail.com
Mon Aug 14 21:58:46 CDT 2006
<div id="filelist"> <div class="NOR PRI DIR" id="images"><img>1</div> <div class="NOR PUB TXT" id="bugs.txt"><img>2</div> <div class="SEL PRI PDF" id="bugs.pdf"><img>3</div> <div class="NOR PUB MOV" id="bugs.mov"><img>4</div> </div>
(You can't do anything with this, this way you wont be able to later
separate the clicks that easily).
I think you need to separate icons from the text in order to get clear click events.
All you need to do now is to set the (css property)
display: inline
for images (icons) and the script lines:
var filelist = o.parentNode;
filelist.insertBefore(newimg, o);
will become fruitful.
Because if you place images inside the div containing f.i. text bugs.ext
you will get back to where you've started it.
P.S.:
I case images continue to drop new line as before, please add this alert
to (bottom of) your js code:
alert(filelist.innerHTML)
so I can see what is happening within the html code~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060815/0a42e64e/attachment.htm>
More information about the Javascript
mailing list