magnific-popup


Magnific popup - undefined is not a function when parsing markup


So I'm using Magnific Popup and whenever I use my own inline template and do the whole parsing of the markup, the line that fails is 231. Here is my code:
http://codepen.io/anon/pen/WbaWLa
This is my HTML:
<div id="featured-works" class="gallery">
<div class="piece">
<a rel="gallery" title="Girl Holding Flowers" href="/themes/images/grid/image1.png" data-description="This one has a description">
<p class="caption">Girl Holding Flowers</p>
<img src="/themes/images/grid/image1.png" alt="image" />
</a>
</div>
<div class="piece">
<a rel="gallery" title="Girl Kissing Father" href="/themes/images/grid/image2.png" data-description="">
<p class="caption">Girl Kissing Father</p>
<img src="/themes/images/grid/image2.png" alt="image" />
</a>
</div>
</div>
Here is my Javascript:
var data = [];
$('.gallery a').each(function(e) {
var item = {
title: $(this).attr('title'),
href_img: $(this).attr('href'),
description: $(this).attr('data-description')
};
data.push( item );
});
$(".gallery").magnificPopup({
delegate: 'a',
type: 'image',
items: data,
type: 'inline',
closeOnContentClick: true,
inline: {
// Define markup. CLass names should match key names.
markup: '<div class="white-popup"><div class="mfp-close"></div>' +
'<span class="mfp-title"></span>' +
'<div class="mfp-href"></div>' +
'<div class="mfp-description"></div>' +
'</div>'
},
gallery: {
enabled: true
}
});
The line that is failing is 231 in magnific popup which is in the _parseMarkup function. This is how that function looks:
_parseMarkup: function(b, c, d) {
var e;
d.data && (c = a.extend(d.data, c)), y(f, [b, c, d]), a.each(c, function(a, c) {
if (c === undefined || c === !1) return !0;
e = a.split("_");
if (e.length > 1) {
var d = b.find(j + "-" + e[0]);
if (d.length > 0) {
var f = e[1];
f === "replaceWith" ? d[0] !== c[0] && d.replaceWith(c) : f === "img" ? d.is("img") ? d.attr("src", c) : d.replaceWith('<img src="' + c + '" class="' + d.attr("class") + '" />') : d.attr(e[1], c)
}
} else b.find(j + "-" + a).html(c)
})
},
The code: e = a.split("_"); is what is failing.. it's saying undefined is not a function. I did a console.log(a) before that and before the error is thrown, 0 is returned.. I don't know where they got that 0 from though so.. not sure.
When I do a console.log() on my data variable, this is what is being pulled:
Object, Object]0: Object
description: ""
href_img: "http://rayndee.localhost/themes/light-fixed-width/images/grid/image2.png"
title: "Girl Kissing Father"
__proto__: Object
1: Object
description: "This one has a description"
href_img: "http://rayndee.localhost/themes/light-fixed-width/images/grid/image1.png"
title: "Girl Holding Flowers"
__proto__: Object
length: 2__proto__: Array[0]
Thank you for any help!

Related Links

Toggle verticalFit on an open image?
Does Magnific Popup support custom events/buttons
I can't get the overflowY option to work in magnific popup
magnific popup group do not working
Magnific-popup: how to get image url from <img src=“…”>?
Styling magnific-popup arrows
magnific popup modal closes on click
Magnific popup: getting “The image could not be loaded”
How to give a fixed size to image in magnific-popup pluggin
magnific popup Inline Lightbox Gallery how to specify item in array from html link
how to make browser back close magnific-popup
Simple Magnific Popup Gallery not working
Magnific Popup onload calling a url
callbacks not firing when opening a magnific popup from another one
Magnific Popup - taller mfp-bottom-bar causes max image height issue
How to generate a (magnific popup)-gallery without a-tags

Categories

HOME
winforms
multithreading
wso2-am
date
octobercms
google-docs
c#-2.0
serverspec
adfs
gz
fortumo
dosgi
fatal-error
propel
conemu
visjs
mps
chromium-embedded
tibco-mdm
format-specifiers
claims-based-identity
angular2-aot
vlsi
semantic-analysis
nhapi
rst2pdf
fopen
opentype
subdomains
primitive
tinymce-4
ecto
perlin-noise
stringtemplate
avcapturesession
force-layout
nssegmentedcontrol
file-format
dosbox
git-merge
scaffold
espeak
jna
ansible-playbook
leading-zero
avro4s
sql-server-agent
janrain
convertapi
komodoedit
qsslsocket
promela
python-webbrowser
mplayer
font-size
windows-mobile-6.5
abcpdf9
home-directory
transmitfile
django-debug-toolbar
autorest
firebaseui
prettytensor
pagerank
asp.net5
energy
jfugue
cannon.js
libressl
computer-algebra-systems
sankey-diagram
operation
sniffer
p2
e10s
device-orientation
modalpopup
tween
codeigniter-url
eol
uitouch
resty-gwt
cloud-connect
intentservice
industrial
oam
.aspxauth
sitemesh
smtp-auth
drools-planner
factory-method
typoscript2
cisco-jtapi
tridion-worldserver
jspinclude
hosts-file
data-loss
user-friendly
project-hosting
document-conversion

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App