Hitori
Hitori

Reputation: 589

Foundation Reveal is removing DOM

i don't know if it's a bug or glitch. but when i try to make a reveal component the usual way by adding data-reveal attribute on it, it always removes the Reveal DOM . it's weird because it's working on most pages, but not in page1.

i can't reproduce the bug because i used the common way of doing it.

what's happening is when the document loaded, it instantly removes the reveal DOM. i also tried removing the data-reveal attribute and instantiate a new one via javascript like this

var elem = new Foundation.Reveal($modal);
console.log(elem);

well of course it would instantiate, but when i looked at my page DOM, it's gone!

please help. i checked all my js files. and there's nothing wrong that could remove the Reveal DOM

See the attached picture. black is my html code and the white is chrome's debugging console enter image description here

Upvotes: 0

Views: 298

Answers (1)

Ross
Ross

Reputation: 2141

This is "by design". Foundation first removes reveal container and then appends it back to either body element or the created overlay. The same thing should be happening on your other pages. If you need additional content is should go inside the reveal DIV, not the parent. There should be no reason to wrap reveal in any additional DIVs. See foundation.reveal.js, line 67-72.

if(this.$overlay) {
  this.$element.detach().appendTo(this.$overlay);
} else {
  this.$element.detach().appendTo($('body'));
  this.$element.addClass('without-overlay');
}

Upvotes: 1

Related Questions