Jump to content

coderage

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

coderage's Achievements

Member

Member (2/5)

0

Reputation

  1. I figured it out. This needed to be done in the javascript function function addTail() { tailCount++ // now 3 var d=document.getElementById('mainbox'); var d2=document.getElementById('mover'); ' ADDITION var newTile=document.createElement("IMG"); newTail.style.position='absolute'; ' ADDITION newTail.setAttribute('src','tiles/3.jpg'); newTail.setAttribute('id',tailCount); newTail.setAttribute('height',256); newTail.setAttribute('width',256); newTail.style.left=nl[tailCount-1]; newTile.style.top=0; d.appendChild(newTail); REPLACING this line with d.insertBefore(newTail, d2); } Thanks for the DOM suggestion
  2. I figured it out, these things needed to be done in the javascript function function addTail() { tailCount++ // now 3 var d=document.getElementById('mainbox'); var d2=document.getElementById('mover'); ' ADDITION var newTile=document.createElement("IMG"); newTail.style.position='absolute'; ' ADDITION newTail.setAttribute('src','tiles/3.jpg'); newTail.setAttribute('id',tailCount); newTail.setAttribute('height',256); newTail.setAttribute('width',256); newTail.style.left=nl[tailCount-1]; newTile.style.top=0; d.appendChild(newTail); REPLACING this line with d.insertBefore(newTail, d2); } Thanks for the DOM suggestion
  3. This is complete BODY tag of the page. DOM inspector shows the new images add to the "mover" DIV. <div id="mainbox" style="overflow:hidden; border:1px solid red; position:absolute; left:256; top:100; height:512px; width:768px;"> <img id="101" src="1.jpg" style="height:256px; width:256px;" alt="1"></img> <img id="102" src="2.jpg" style="height:256px; width:256px;" alt="2"></img> <div id="mover" style="overflow:hidden; border:0px solid blue; position:absolute; left:0; top:0; height:512px; width:768px;" onMouseDown="mainboxMouseDown(event);" onMouseUp="mainboxMouseUp(event);" onMouseMove="mainboxMouseMove(event);"> </div>
  4. This is the complete BODY tag of the page. and i installed the DOM inspector, my initial install didint have it , thanks for the idea. When i inspected it shows the new images being added to the "mover" DIV. But i need to keep that up to be able to move my images with mouse. confused ! <div id="mainbox" style="overflow:hidden; border:1px solid red; position:absolute; left:256; top:100; height:512px; width:768px;"> <img id="101" src="1.jpg" style="height:256px; width:256px;" alt="1"></img> <img id="102" src="2.jpg" style="height:256px; width:256px;" alt="2"></img> <div id="mover" style="overflow:hidden; border:0px solid blue; position:absolute; left:0; top:0; height:512px; width:768px;" onMouseDown="mainboxMouseDown(event);" onMouseUp="mainboxMouseUp(event);" onMouseMove="mainboxMouseMove(event);"> </div>
  5. No there are no Z-indexes declared. and i tested the image attribute declaration too.. it has no effect im stumped !
  6. Hi I have (1) <DIV id="mainbox" style="overflow:hidden; border:1px solid red; position:absolute; left:100; top:100; height:400px; width:400px;"> <img id="101" src="1.jpg" style="height:100px; width:100px;" alt="1"></img> <img id="102" src="2.jpg" style="height:100px; width:100px;" alt="2"></img> </DIV (2) I can move these two images in the DIV using Javascript. (3)But when i add a new image using document.createElement("IMG") and add to this DIV using function addTail() { tailCount++ // now 3 var d=document.getElementById('mainbox'); var newTile=document.createElement("IMG"); newTail.setAttribute('src','tiles/3.jpg'); newTail.setAttribute('id',tailCount); newTail.setAttribute('height',256); newTail.setAttribute('width',256); newTail.style.left=nl[tailCount-1]; newTile.style.top=0; d.appendChild(newTail); } the new image is added in the mainbox DIV but, not accessible. i want it to get attached to the end of the existing 2 boxes (like snake game) but instead the new imaged keeps lying on in the background inside the DIV and the First two images move inside the DIV on top of the new one. Sombody plz tell me how to fix this. thanks
  7. Hi I have (1) <DIV id="mainbox" style="overflow:hidden; border:1px solid red; position:absolute; left:100; top:100; height:400px; width:400px;"> <img id="101" src="1.jpg" style="height:100px; width:100px;" alt="1"></img> <img id="102" src="2.jpg" style="height:100px; width:100px;" alt="2"></img> </DIV (2) I can move these two images in the DIV using Javascript. (3)But when i add a new image using document.createElement("IMG") and add to this DIV using function addTail() { tailCount++ // now 3 var d=document.getElementById('mainbox'); var newTile=document.createElement("IMG"); newTail.setAttribute('src','tiles/3.jpg'); newTail.setAttribute('id',tailCount); newTail.setAttribute('height',256); newTail.setAttribute('width',256); newTail.style.left=nl[tailCount-1]; newTile.style.top=0; d.appendChild(newTail); } the new image is added in the mainbox DIV but, not accessible. i want it to get attached to the end of the existing 2 boxes (like snake game) but instead the new imaged keeps lying on in the background inside the DIV and the First two images move inside the DIV on top of the new one. Sombody plz tell me how to fix this. thanks
  8. Hi I have Winxp + Apache 2.2 + PHP 5 I am tryin to install PHP GTK... this is what i did so far 1- copied all the files in php-gtk->php4 folder (all the dlls) into my existing php5' extensions folder 2- appended the [php-gtk] extension part in the php-gtk ini.... into my existing php5 ini file. when i tried to run the examples that came with the php-gtk this is the error im getting : Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_gtk.dll in your php.ini in D:\htdocd\test\combobutton.php on line 5 Fatal error: Class 'GtkWindow' not found in D:\htdocs\test\combobutton.php on line 8 Please suggest how to fix this. Thanks
  9. Hi My Apache 2.2.4 , PHP 5.2.1 Win xp pro Web sever suddenly stoped working. Its loaded and shows Started in task bar. But when trying to connect at http://localhost or the url i have , it just keeps on "opening page http://localhost" it was working fine, duno what happend. Please help
  10. If you are using mysql database, this query will do the trick LOAD DATA INFILE "C:\\YOURFILE.CSV" INTO TABLE YOURTABLE FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; NOTE: Here you are using ' , ' as delimiter for fields, this means if some field in your tuple/ row of csv file has data such as text which in turn has comma in it, it will be broken down into two fields. So "condition" your csv file before you use this query. for simple example, try to import a file with these two lines in a test table with three fileds 1234,abcd,blue : will go ok 1234,ab,cd,blue : will no be imported as it will break ab,cd (which is one field in example) into two fields goodluck
  11. Hi, I have a map stored in the form of image tiles (small pieces of MAP in jpg format), like google. I want to know how the map such as google displays the maps using tiles and on panning(moving the image it automatically loads required tiles. Can someboy please guide me how this is done. Thanks
  12. they are initiated to -1. they get latitude and lontitude values from database, their format is Lat: 1234.1234 , Long: 2345.4567 This problem arises mainly when both $dlat1 and $dlat2, $dlong1 and $dlong2 are same.
  13. Heres the code, the $diff variable gets the output value (sometimes) -1.#IND and if i use echo round($diff,2); it shows "nan" on screen $sin_dlat1 = sin($dlat1); $sin_dlat2 = sin($dlat2); $cos_dlat1 = cos($dlat1); $cos_dlat2 = cos($dlat2); $cos_long_diff = cos($dlong2 - $dlong1); $diff = acos($sin_dlat1*$sin_dlat2 + $cos_dlat1*$cos_dlat2*$cos_long_diff);
  14. Hi i am doing some floating point, trignometric calculations and i get "nan" as a result value or -1.#IND as a result value for some starting values. what is this ? please explain.
  15. Im trying to adjust colors of the Dreamweaver for PHP, all is dont except i cant find a way to change color for the delimiter " ;" the comma " , " and " || " operator. Dnt know which category they fall in. Sum1 plz suggest a solution.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.