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

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
Add data to items in Magnific Popup
How to set the divs to make Magnific Popup animations work
how to display map in mobile devices using magnific popup?
Magnific Popup - Counter in Videogallery
how to manually open and close the popup using Magnific-Popup
How to customize arrows and close button?
no closing “X” with inline content
How to prevent close
Magnific-Popup Loading iframe from non-video players URL
Magnific popup - put arrows inside of an image
magnific closeOnContentClick does not work
How can style popup iframe in Magnific Pop-Up?
Gallery with mixed content types

Categories

HOME
xamarin
ionic-framework
osgi
hive
single-sign-on
bpmn
read-eval-print-loop
filtering
spring-jdbc
electronics
win32gui
yum
ssl-client-authentication
adobe-analytics
here-api
serverless-framework
workload-scheduler
reactcsstransitiongroup
evopdf
introduction
object-detection
xlsxwriter
jasonette
excel-2007
entitlements
kendo-datasource
sql-server-2012-express
semantic-versioning
titanium-mobile
ghost4j
picasso
abstract-class
uft-api
leading-zero
sas-visual-analytics
ws-security
galen
total-commander
scorm
skeleton-css-boilerplate
jsch
dotcover
dds
boost-multi-index
datastax-startup
veracode
sqlclient
feeds
libusb-win32
android-cursor
python-cryptography
gcsfuse
iso8601
redundancy
crosswalk-runtime
medium.com
vmware-tools
url-masking
py2app
impresspages
clang-static-analyzer
blackberry-10
sigabrt
design-by-contract
ford-fulkerson
jfugue
ios8-today-widget
vhd
execute
comobject
tmuxinator
responsive-images
sonarqube5.1.2
truevault
c++03
c3
asp.net-dynamic-data
mdt
device-manager
article
heisenbug
tld
elliptic-curve
typo3-neos
uv-mapping
bulkloader
cos
pushbackinputstream
type-equivalence
delphi-6
anonymous-methods
broken-links
datawindow
errai
hosts-file
dbproviderfactories
getmessage
amazon-appstore
asyncfileupload
bigcouch
xmlspy
perfect-hash
database-management
compiler-specific
nerddinner

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