PDA

View Full Version : dynamic slidshow from mysql



niceguy82
05-06-2010, 05:42 PM
1) Script Title:

3) Describe problem: 1) Script Title: dynamic slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:hi everyone i want to select last 10 image added to database and slid it by javascript in slidshow i made the selection and collect the last 10 paths from DB and put it in array now i want to make slideshow by javascript
can anyone help me with that i'll be thankful
this is the code i made it by some modify in the slidshow script


<?php
include("config.php");
$q=mysql_query ("select Car_pic from car order by Car_id desc LIMIT 10") or trigger_error(mysql_error(),E_USER_ERROR);
$newarray=array();
$i=0;
while($row=mysql_fetch_assoc($q))
{
$newarray[]=$row[Car_pic];

}
for ($i=0;$i<=10;$i++)
echo $newarray[$i];

?>
<style type="text/css">
div#container
{
width: 616px;
position: relative;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
</style>
<style type="text/css">
body
{
text-align: center;
margin: 0;
background-color: #FFFFFF;
color: #000000;
}
</style>
<script type="text/javascript">
<!--
function FadeImage(id, duration)
{
var millisec = Math.round(duration / 100);
var timer = 0;
for(i = 0; i <= 100; i++)
{
setTimeout("SetOpacity('" + id + "'," + i + ")",(timer * millisec));
timer++;
}
}
function SetOpacity(id, opacity)
{
var element = document.getElementById(id).style;
element.opacity = (opacity / 100);
element.MozOpacity = (opacity / 100);
element.KhtmlOpacity = (opacity / 100);
element.filter = "alpha(opacity=" + opacity + ")";
}
//-->
</script>
<script type="text/javascript">
<!--

// -->
</script>
<style type="text/css">
a:active
{
color: #0000FF;
}
</style>
</head>
<body>

<script type="text/javascript">
<!--
var SlideShow1_Index = -1;
var SlideShow1_Images = new Array();
for(int i=0;i<=10;i++){
SlideShow1_Images[i] = image[i];
}
function SlideShow1ShowNext()
{
SlideShow1_Index = SlideShow1_Index + 1;
if (SlideShow1_Index > 2)
SlideShow1_Index = 0;
document.getElementById('SlideShow1_Fade').src = document.getElementById('SlideShow1').src;
SetOpacity('SlideShow1', 0);
eval("document.SlideShow1.src = SlideShow1_Images[" + SlideShow1_Index + "][0]");
setTimeout("SlideShow1ShowNext();", 2000);
FadeImage('SlideShow1', 1500);
}
// -->
</script>
<img src="images/.jpg" style="position:absolute;left:0px;top:0px;" id="SlideShow1_Fade" border="0" align="top" alt="" width="562" height="444" name="SlideShow1_Fade">
<img src="images/.jpg" style="position:absolute;left:0px;top:0px;" id="SlideShow1" border="0" align="top" alt="" width="562" height="444" name="SlideShow1">
<script type="text/javascript">
<!--
SlideShow1ShowNext();
// -->
</script>
</div>
<div id="wb_SlideShow2" style="position:absolute;left:318px;top:395px;width:0px;height:0px;z-index:3;overflow:hidden" align="left">
</div>
</div>
</body>
</html>




where is the problem and what should i do
thank you a

niceguy82
05-07-2010, 10:03 PM
no replay until now is that hard my question is ??!!:confused:

jscheuer1
05-08-2010, 02:36 AM
Please post a link to a page on your site that contains the problematic code so we can check it out.

niceguy82
05-08-2010, 10:51 PM
thank you for your replay
this is the link i need to slidshow in the same place not show all images


http://www.2worldshopping.com/test/slidshow.php

i don't know where's the wrong
i hope u can help me

jscheuer1
05-09-2010, 12:05 AM
I see no Dynamic Drive script on that page. If I'm mistaken, let me know where it is, or give a link to your page that has a Dynamic Drive script on it.

niceguy82
05-09-2010, 11:28 AM
thank you jscheuer1 i hope you can help me with this problem
i submited all the code i have without th database is there any thing missing maybe it's the problem ??
i waitting your solution
thank you