Sample Gallery Code Not working as expected


Topic: Sample Gallery Code Not working as expected

Fields Marshall asked 6 years ago

Expected behavior

https://mdbootstrap.com/plugins/jquery/gallery/#carousel-2 is not working as expected

Actual behavior

javascript errors mdb.min.js:1 Uncaught TypeError: Cannot read property 'firstChild' of undefined at Object.getChildByClass (mdb.min.js:1) at Object.init (mdb.min.js:1) at i (mdb.min.js:1) at HTMLDivElement.e (mdb.min.js:1)

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/snippets/jquery/fields_marshall/618613


Bartłomiej Malanowski staff pro premium answered 6 years ago

On your snippet simply change your javascript section to look like this:

// MDB Lightbox Init
$(function () {
  $("#mdb-lightbox-ui").load("https://mdbcdn.b-cdn.net/wp-content/themes/mdbootstrap4/mdb-addons/mdb-lightbox-ui.html");
});

Ahh ok .. Thanks now I understand


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.6
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes
Tags