Affordable Digital Marketing Services

If you need affordable yet effective digital marketing, Ankit is your guy. Honest advice and great support.

'; } return; } currentIndex = index; const review = reviewsData[index]; const container = document.getElementById('wg-rsp-dynamic-review'); if (!container) return; const attachmentHtml = review.attachment_url ? `` : ''; const html = `

${review.title}

${review.content}
${attachmentHtml}
`; container.innerHTML = html; // Update counter const currentElement = document.querySelector('.wg-rsp-current'); if (currentElement) { currentElement.textContent = index + 1; } // Update navigation buttons const prevBtn = document.querySelector('.wg-rsp-nav-btn[data-direction="prev"]'); const nextBtn = document.querySelector('.wg-rsp-nav-btn[data-direction="next"]'); if (prevBtn) prevBtn.disabled = index === 0; if (nextBtn) nextBtn.disabled = index >= reviewsData.length - 1; // Re-initialize click handlers for the new review initSingleReviews(); } // Navigation button handlers const navButtons = document.querySelectorAll('.wg-rsp-nav-btn'); navButtons.forEach(function(btn) { btn.addEventListener('click', function() { const direction = this.getAttribute('data-direction'); if (direction === 'prev' && currentIndex > 0) { renderReview(currentIndex - 1); } else if (direction === 'next' && currentIndex < reviewsData.length - 1) { renderReview(currentIndex + 1); } }); }); // Listen for submitted reviews document.addEventListener('reviewSubmitted', function(e) { submittedReviews.push(e.detail.reviewId); }); // Initialize first review renderReview(0); } })();