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 Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/ Share on other sites More sharing options...
fenway Posted May 6, 2007 Share Posted May 6, 2007 OK, and what's happening? Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-246640 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. Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-247002 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 Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-247267 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. :'( Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-247812 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 Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-247918 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. Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-249091 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> Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-250314 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. Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-250632 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? Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-251899 Share on other sites More sharing options...
riddhi Posted May 15, 2007 Author Share Posted May 15, 2007 someone please help Link to comment https://forums.phpfreaks.com/topic/50136-what-is-the-problem/#findComment-253377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.