data-lightbox ajax setAttribute not working in js.

1 reply · opened Feb 13, 2024

OolubernFeb 13, 2024

I'm trying to create product listing as shown in shop-layout-4.html. However the "Quick View" button is not visible on hover and popup is not working. How can I fix this.
` var bgOverlay = document.createElement('div');
bgOverlay.classList.add('bg-overlay');
productImage.appendChild(bgOverlay);

  var bgOverlayContent = document.createElement('div');
  bgOverlayContent.classList.add('bg-overlay-content', 'align-items-end', 'justify-content-center', 'p-0');
  bgOverlay.appendChild(bgOverlayContent);

  var quickViewLink = document.createElement('a');
  quickViewLink.href = 'include/ajax/shop-item.html';
  quickViewLink.classList.add('btn', 'btn-light', 'py-2', 'w-100', 'm-0', 'rounded-0');
  quickViewLink.setAttribute('data-lightbox', 'ajax');
  quickViewLink.setAttribute('data-hover-animate', 'fadeInUp');
  quickViewLink.setAttribute('data-hover-animate-out', 'fadeOutDown');
  quickViewLink.setAttribute('data-hover-speed', '400');
  quickViewLink.setAttribute('data-hover-parent', '.product');
  quickViewLink.textContent = 'Quick View';
  bgOverlayContent.appendChild(quickViewLink);
SSemicolon WebSTAFFFeb 14, 2024

Hello,

Since, currently Customization related Support is not included with the License according to the Item Support Policy: https://themeforest.net/page/item_support_policy . You will need to manually code this or Hire Us to help you out with Customizations.

Additionally, you can consider providing us with a Live URL so that we can check out the exact issue and provide you with more accurate assistance on this. But since this is a Customization related request, Support on this will be limited to basic solutions. Thanks for your Patience.

You can consider calling the following JS Function in order to initialize the Quick View Lightbox trigger:

SEMICOLON.Modules.lightbox();

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard