How to dynamically load an entire image from a folder for an image slide show - jquery

Basically, what I need is a way to dynamically load all the images in a folder (stored on the server) into my nivo slider. Currently, the nivo script slider requires me to link to each photo separately. For instance:

<div class="slider-wrapper theme-default">
        <div class="ribbon"></div>
        <div id="slider" class="nivoSlider">
            <img src="images/toystory.jpg" alt="" />
            <a href="http://dev7studios.com"><img src="images/up.jpg" alt="" title="This is an example of a caption" /></a>
            <img src="images/walle.jpg" alt="" data-transition="slideInLeft" />
            <img src="images/nemo.jpg" alt="" title="#htmlcaption" />
        </div>

(the above code was taken from the html file).

Since novice users will maintain the website, they will not be able to log in and manually change the code each time they add or remove photos from the catalog.

At this point, I don’t mind if all or some of the photos are loaded when the page loads.

- , . , , ( ( ), ).

, , jquery ( ), . , , , .

( ), jscript css, . html - ( sharepoint -), .

, ?

+3
5

, , . , , .

  • , tomcat, . , ajax-, , , jpg , .

  • , , ( , , ), , .

0

javascript, ajax- ( ). Google - jquery- -.

0

nivo, .

:

  • , . , image dom

  • javascript ajax-, , , dom

, nivo ,

  • update nivo code to add new images.
0
source

Can get image from directory server using php and dropzone.js

please check out this practical link http://www.startutorial.com/articles/view/dropzonejs-php-how-to-display-existing-files-on-server

0
source

This will put the image names in a Javascript array:

$dir = 'images/c-data/' . $result; //set the working directory
$pics = scandir($dir);
unset($pics[0], $pics[1]); //first and second ellement are the "."".." , get rid of them
$string = '<script type ="text/javascript">var images_' . $result . ' =[ ';
foreach ($pics as $key => $item) {
    $string .= '"' . $item . '",';
}
echo substr($string, 0, -1) . "];</script>";

This will cause echoes as they pass through them:

$path = 'images/c-data/';
$results = scandir($path);
$dirArray = array();
unset($results[0], $results[1]); //first and second ellement are the "."".." , get rid of them
foreach ($results as $result) {
    echo 'Image' . $result . ', ';
}

In both cases, we use php scandir()one that returns an array of all the elements in the directory.

0
source

All Articles