|
Post by Eric on Apr 2, 2005 11:07:19 GMT -8
Info in code header:
<script> <!-- /* Made by Eric Rykwalder You may edit and use pieces from this script as long as my name is included in the header of the script somewhere and it remains open source and I am updated of anything you do with it. (c) 2005 Eric Rywkalder ----------------------------------------------------------------------------- What it is: A DHTML Affiliate Bar Crossbrowser: At least in Gecko and Internet Explorer Placement: Wherever you want it to show Why make it like this: I have been informed that the marquee tag is not proper XHTML, so I thought this might be better supported by XHTML */ var affiliates=new Array(); //Affiliates Here affiliates[0]=new Array('','');
//Vars able to be edited //As of now negative vars are not supported var amount=92*affiliates.length; //Recommended to leave this alone var px=-amount;//Recommended to leave this alone var width=400; //Width of affiliate bar var x=1; //Pixels to move //Increasing makes it faster var time=0; //Time to wait //Increasing makes it slower
//Do not edit below unless experienced function moveit(){ var test=document.getElementById('test'); test.style.left=+px+'px'; if(px==width+5){ px=-amount; } px+=x; setTimeout("moveit()",time); } document.write('<table align="center" class="bordercolor" border="0" cellspacing="1">'); document.write('<tr><td class="titlebg" height="20"><font size=2 class=titletext color="000000"><b>Affiliates</b></font></td></tr><tr>'); document.write('<td class="windowbg" style="height:40px;">'); document.write('<div id="holder" style="position:relative;width:'+width+'px;height:60px;overflow:hidden;">'); document.write('<div id="test" style="position:relative;">'); for(i=0;i<affiliates.length;i++){ document.write('<a href="'+affiliates[i][1]+'" target="blank"><img src="'+affiliates[i][0]+'" border="0" /></a> '); } document.write('</div></div>'); document.write('</td></tr></table>'); moveit(); //--> </script>
|
|
100%
|
Post by Aaron on Apr 2, 2005 11:15:15 GMT -8
What does this code do? I tried it out and I watched an image move.
|
|
|
Post by Eric on Apr 2, 2005 11:29:10 GMT -8
What does this code do? I tried it out and I watched an image move. lol It is an affiliate bar, you know like all the others except that it doesn't use the marquee tag, it uses DHTML.
|
|
|
Post by CrAzY_J on Apr 2, 2005 12:39:08 GMT -8
w00t, im totally gonna study this. thanks for the submission Eric
|
|
|
Post by Eric on Apr 2, 2005 13:06:45 GMT -8
w00t, im totally gonna study this. thanks for the submission Eric No problem, also, feel free to edit mine as it says in the header.
|
|
|
Post by ShadowyOne on Apr 2, 2005 13:14:40 GMT -8
Pretty cool.
What is DHTML used for, though?
|
|
100%
|
Post by Aaron on Apr 2, 2005 13:22:29 GMT -8
lol It is an affiliate bar, you know like all the others except that it doesn't use the marquee tag, it uses DHTML. Oh, cool!
|
|
|
Post by Eric on Apr 2, 2005 13:28:58 GMT -8
Pretty cool. What is DHTML used for, though? DHTML is Dynamic HTML. It uses Javascript and CSS to make some cool stuff. As you can see I use the .style a lot, which is CSS attributes
|
|
|
Post by Marty on Apr 2, 2005 13:31:25 GMT -8
Nice work. What is DHTML used for, though? The D stands for dynamic, so it's basically used to make stuff move. Edit: A little too slow.
Last Edit: Apr 2, 2005 13:32:22 GMT -8 by Marty
|
|
|
Post by Uchiha Susuke on Apr 4, 2005 17:30:26 GMT -8
pretty useful, as far as i know, there's some browser compadibility problems with the marquee tag, so this should be useful
and (i haven't tried it yet, so i'm just assuming you did it) using DHTML would get rid of the full loop problem that marquee has to go through (meaning that before it starts over, all the information in the marquee must pass through, then, once the last part has dissappeared from the boundry is when the loop will start over again, where as in DHTML you wouldn't have to wait for the information to completely end before starting it over again)
|
|