good morning bob
Yes you are right, the slider-container will be no longer working with my solution....
another question:
I have now a file upload field using the preview function. The image is used as a background-image. is already a picture stored on the server, it is displayed with the database-read function in the same area.
the Problem now: when I select a new image, it is displayed behind the actual image. how can I solve it, that is displayed the existing image in the background and when I select a new Picture, this will be changed in the preview-area?
furthermore, do you know a possible way to delete the old picture in the upload folder when i upload a new one
I hope, that you unterstand, what i mean 😲
My english is not the best, i know 🙄
Thank you very much for your efforts
Load-JS (Setup/onload) Funktion (preview)
jQuery(document).ready(function(jQ) {
var uploadFile;
// edit this line to the id of the file element
uploadFile = 'file1';
uploadFile = jQ('#'+uploadFile);
uploadFile.on('click', function() {
});
uploadFile.on('change', function() {
var files, reader;
files = !!this.files ? this.files : [];
if ( !files.length || !window.FileReader ) {
return; // no file selected, or no FileReader support
}
if ( /^image/.test(files[0].type) ) { // only image file
reader = new FileReader(); // instance of the FileReader
reader.readAsDataURL(files[0]); // read the local file
reader.onloadend = function() { // set image data as background of div
jQ('#imagePreview').css('background-image', 'url(' + this.result + ')');
jQ('#imagePreview').show();
}
}
});
});
Display the existing Image Funktion (designer/custom Code)
<?php
if ( isset($form->data['thumb_small']) && $form->data['thumb_small'] ) {
echo "<img src='".JURI::root()."images/uploadfiles/{$form->data['thumb_small']}' style='max-width:175px' />";
}
?>
Chronoforms 5, Joomla!-Version 3.4.5