jquery - How to add link to Magnific Popup's javascript -


I have a massive popup on my app and I need help to take action on the lightbox. I've added my code in and out of JavaScript but it never appears inside the lightbox.

I have to add several pieces to the Lighthouse, such as a link that will allow the user to create a profile image, message composition box, and user's small bio. If I can learn how to do one, then I have full confidence that I can rest.

The action is

show.html.erb:

  & lt; H1 & gt; & Lt;% = @ User Username% & gt; & Lt; / H1> & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('parent-container'). MagnificPopup ({Representative: 'a', type: 'image', gallery: {enabled: true}})}}); & Lt; / Script & gt; & Lt; Div class = "parent-container" & gt; & Lt;% @ user.photos.each do Photos | & Gt%; & Lt;% = link_to image_tag (photo.image_url (thumb)), photo.image_url% & gt; & Lt;% end% & gt; & Lt; / Div & gt; & Lt; / P & gt;  

tell Magnific popup to open (a div with the image and your additional content ), Example:

  & lt; Script & gt; $ (Document) .ready (function () {$ ('parent-container'). MagnificPopup ({Representative: 'a', type: 'inline', gallery: {enabled: true}})}}); & Lt; / Script & gt; & Lt; Div class = "parent-container" & gt; & Lt;% @ user.photos.each do Photos | & Gt%; & Lt;% = link_to image_tag (photo.image_url (thumb)), "#" + dom_id (photos)% & gt; & Lt; Div id = "& lt;% = dom_id (photos)% & gt;" Class = "mfp-hyd" & gt; & Lt;% = image_tag (photo.image_url)%> & Lt;% = button_to ('Set as profile image', [: avatar, photo @])%> & Lt; / Div & gt; & Lt;% end% & gt; & Lt; / Div & gt;  

You will need popup style;

(If Ruby Code is broken, I am not actually a ROR person.)


Comments