We need a function to trigger a plugin ([login to view URL] - [login to view URL]) to display a lightbox gallery. We need to reuse the function in several places, so we call it using a data attribute on the DOM elements (data-gallery). This element, in addition to triggering the function, contains all the information needed to add the images to an array that is then used in the plugin call. So far everything seems to be fine, but when it comes to using the array in the plugin code, something goes wrong. If the same array is copied and pasted manually into a variable, then it works.
The job is to fix the bug (whatever it is), optimize the code as much as possible and make it work. For those who know how to do it, I don't think it is even necessary to share the files, directly with the function you should be able to correct it.
Please, if you don't see the bug directly in the code, don't send a bid. Thank you.
//CODE
var initGallery = function () {
$("[data-gallery]").each(function () {
var $this = $(this),
destination = $[login to view URL]("id"),
order = $[login to view URL]("order") + "_",
count = $[login to view URL]("count"),
continent = $(".section-cabecera").data("continent") + "/",
folder = "/Content/img/destinations/",
path = folder + continent + order + destination + "/" + destination + "_";
var pictures = [];
for (var i = 1, limit = count + 1; i < limit; i++) {
[login to view URL](" {src: '" + path + i + ".jpg' }");
}
/* Just to check that the array is correct */
[login to view URL](pictures);
/* This returns manualArray as text */
var array = [login to view URL]([login to view URL]()),
formatedArray = "[" + [login to view URL]().replace('"', '').replace('"', '') + "]";
/* Pass the array to string just to create a manual variable and test it */
$("#result").html(formatedArray);
/* This Works. Is just the previous text copied and pasted */
var manualArray = [
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' },
{ src: '/Content/img/destinations/africa/04_namibia/[login to view URL]' }
]
/* LightGallery Plugin */
var gallery = lightGallery($this, {
dynamic: true,
mode: "lg-zoom-out",
loop: false,
download: false,
plugins: [lgAutoplay, lgFullscreen],
dynamicEl: pictures
});
[login to view URL](destination).addEventListener("click", function () {
[login to view URL]();
});
});
}
Hii,
How are you??
I am neha , checked your requirements and understood complete scope of the work and you looking out someone can understand and fix bug and resolve issue so share me credential with an opportunity to start work together ..
Sure i will deliver you quality work ...
Ping me !
Thanks
Hello
I have 6+ years of experience in Web design and developments.
NOTE: I believe communication is the key to unlocking any successful outcome.
lets discuss the project in detail.
Once done, I will tell you the time estimation based on the exact requirements. I'm looking forward to hearing back from you. Regards Parth Mangukiya
Hello.
I understand your project requirements completely and feel confident to deliver the job perfectly.
Your job really caught me eyes because my experience and expertise are perfect match for your job.
I have 5+ years of rich and strong experience about JavaScript and HTML5.
I you work with me, you will get what you want.
Client's satisfaction is my goal and will continue to work until I give you 100 % results.
And from product distribution to maintenance, I will always strive to provide the best service to our customers and will stick to the contract.
Looking forward to your response.
Thank you.
⭐Thank you for reaching my proposal!⭐ I've read your requirement carefully and understood all.
I am a full stack developer(7 years experiences). I am ready to discuss your project and
can start immediately. I am looking forward to working with you. ⭐Best Regards⭐
Hello,
This task match with my working skills however i have some points to discuss . - I would greatly appreciate the opportunity to be working with you and to discuss my qualifications and your requirements in detail.