0

I am loading images from folder but problem is

first loading div after storing images.

Because of this problem i have to increase loading time div.

<script type="text/javascript">
$(function() {
  $("#snap").click(function() {
     $("#myweb").load("webcamsnap.php")
  })
})
</script>
2
Contributors
3
Replies
18
Views
2 Years
Discussion Span
Last Post by ramsiva
1

You can try this

window.setTimeout(function() {
    $("#myweb").load("webcamsnap.php");
}, 2000);

Inside your function. It will make the load wait 2 seconds before actually executing it.

0

KK problem is solved but one more problem is there.

I am getting first snap using webcam, but second time clicking snap button
"first image coming and at the same time appending first images with 1st image and 2nd image"

any body help me i dont want append images while loading

my code is retrieving images

<div class="row"><label class="col-xs-2">Click On  Ultimate Image</label><div class="col-xs-10"> <?php
$folder = 'webcam/';
$filetype = '*.jpg';
$files = glob($folder.$filetype);
$count = count($files);

echo '<table><tr>';
$sortedArray = array();
for ($i = 0; $i < $count; $i++) {
$sortedArray[date ('YmdHis', filemtime($files[$i]))] = $files[$i];


/*print_r($sortedArray);
krsort($sortedArray);
print_r($sortedArray);*/
foreach ($sortedArray as &$filename) {
#echo '<br>' . $filename;
echo '<td>';
echo '<a  name="'.$filename.'" href="oflinereg.php?imagename='.$filename.'"><img height="100px" width="150px" src="'.$filename.'" /></a>';
$imagename=substr($filename,strlen($folder),strpos($filename, '.')-strlen($folder));
echo '</td>';
}
}
echo '</tr>';
echo '</table>';
?>
</div>
</div>

and loading div is

<script type="text/javascript">
$(function() {
  $("#snap").click(function() {
  window.setTimeout(function() {
     $("#myweb").load("webcamsnap.php");
     }, 5000);
  })
})
</script>

any body help me while clicking total images come from folder not apped to previous image.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.