Jump to content

what is the problem?


riddhi

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.