riddhi Posted May 5, 2007 Share Posted May 5, 2007 In the javascript I am retriving the picture name from database and showing as footer which I want the images to move in a row wise fashion I have written the following PHP code echo "<p><img src=$cat_image id='myImg' style='z-index: 0 left: -100px position: absolute top: 50px'></p>"; echo "<p>"; echo "<script language='JavaScript'>"; echo "moveObjRight('myImg')"; echo "xCo =-100"; echo "function move(obj){"; echo "obj.style.left=xCo"; echo "xCo +=2"; echo "if(xCo < 100) {window.setTimeout('move(' +obj.id+ ')', 0)}"; echo "}"; echo "</script> </p>"; }// End While Loop Quote Link to comment Share on other sites More sharing options...
fenway Posted May 6, 2007 Share Posted May 6, 2007 OK, and what's happening? Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 7, 2007 Author Share Posted May 7, 2007 nothing it is only displaying the images with no images. I want to display in the footer area of my online shop. Quote Link to comment Share on other sites More sharing options...
fenway Posted May 7, 2007 Share Posted May 7, 2007 I don't think you can have a setTimeout of 0 Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 8, 2007 Author Share Posted May 8, 2007 will you please elaborate a bit more with code or reference as I am new to javascript. :'( Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 8, 2007 Author Share Posted May 8, 2007 The error in the IE after html is generated by PHP is "object expected" at the line where <img> tag is there Quote Link to comment Share on other sites More sharing options...
fenway Posted May 9, 2007 Share Posted May 9, 2007 Show the JS code that is being produced. Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 11, 2007 Author Share Posted May 11, 2007 Sorry to be late her is the code :'( <script language='Javascript' type='text/javascript'> xCo =-100; function moveObjRight(obj) { obj.style.left=xCo; xCo +=2; if(xCo < 100) { window.setTimeout('moveObjRight(' +obj.id+');', 0); } } </script></head> <p> <img id='myImg' src='/plaincart/images/product/f3738c5176628516539b1c09140d792f.jpg' style='z-index: 0 left: -100px position: absolute top: 50px'> </p> <script language='JavaScript'> moveObjRight('myImg'); </script> <p> <img id='myImg' src='/plaincart/images/product/182211127b3b784ff1db58d7260232a5.jpg' style='z-index: 0 left: -100px position: absolute top: 50px'> </p> <script language='JavaScript'> moveObjRight('myImg'); </script> <p> <img id='myImg' src='/plaincart/images/product/d92736b4f40f5d4a9a1c1913446e63d1.jpg' style='z-index: 0 left: -100px position: absolute top: 50px'> </p> <script language='JavaScript'> moveObjRight('myImg'); </script> <p> <img id='myImg' src='/plaincart/images/product/003e5198a07571ec000bc6c183d80dfd.jpg' style='z-index: 0 left: -100px position: absolute top: 50px'> </p> <script language='JavaScript'> moveObjRight('myImg'); </script> <p> <img id='myImg' src='/plaincart/images/product/a2d2d31be217aaabdccdf565512212d5.jpg' style='z-index: 0 left: -100px position: absolute top: 50px'> </p> Quote Link to comment Share on other sites More sharing options...
fenway Posted May 11, 2007 Share Posted May 11, 2007 They can't all ahve the same ID.. and that's a very strange way to do that. Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 13, 2007 Author Share Posted May 13, 2007 please show how to go about it? Quote Link to comment Share on other sites More sharing options...
riddhi Posted May 15, 2007 Author Share Posted May 15, 2007 someone please help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.