Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2021-09-03 18:12:55

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

Try to replace the class “slider” with “popup”.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#26 2021-09-03 18:15:02

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

Umm, sorry, I mean replace this here: <div class="slider">


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#27 2021-09-03 18:20:23

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

Javascript expects it literally, no letter more and no character less :)
Just that: popup


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#28 2021-09-03 18:21:56

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: zoom immagine

uli wrote #331511:

Umm, sorry, I mean replace this here: <div class="slider">

Thank you. Excitingly, something has changed! Disappointingly, it says “the image could not be loaded”. When I click on the image it goes to a URL ending with /undefined


Strictly Amateur

Offline

#29 2021-09-03 18:28:07

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

John-Paul, you’ve now named it slider, magnificpopup, and images. Please try for once to name that class “popup”.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#30 2021-09-03 18:30:09

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: zoom immagine

uli wrote #331514:

John-Paul, you’ve now named it slider, magnificpopup, and images. Please try for once to name that class “popup”.

I don’t know how you know that, but I laughed when I read it. I did also try
class=“popup”
AND
popup (just like that)
but nothing improved


Strictly Amateur

Offline

#31 2021-09-03 18:31:00

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

OK, thank you, I can now try to analyse.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#32 2021-09-03 18:32:16

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: zoom immagine

Thank you uli.
I’m extremely grateful for your time and attention.


Strictly Amateur

Offline

#33 2021-09-03 18:36:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,256

Re: zoom immagine

John-Paul, you gave me maybe 3 minutes, before you changed that class back again. I’m out now, sorry.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#34 2021-09-03 18:58:05

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: zoom immagine

uli wrote #331518:

John-Paul, you gave me maybe 3 minutes, before you changed that class back again. I’m out now, sorry.

Uli I sincerely apologise, and completely understand.

I thought it had “not worked”, so I changed it back. Shows how little I know what I’m doing.

I’ll keep investigating. Thank you for the help you gave.

I think I’m a little closer than before…


Strictly Amateur

Offline

#35 2021-09-03 21:39:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,520
Website GitHub

Re: zoom immagine

Seems as if your page is now set up okay but, if I’ve read the documentation correctly then you need to alter the way you kick off the script if you’re using it in ‘parent mode’ (option 2). Try using this construct instead:

$('.popup').magnificPopup({
  delegate: 'a',
  type: 'image',
  gallery: { 
    enabled: true 
  }
});

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#36 2021-09-04 00:04:32

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: zoom immagine

Bloke wrote #331520:

Seems as if your page is now set up okay but, if I’ve read the documentation correctly then you need to alter the way you kick off the script if you’re using it in ‘parent mode’ (option 2). Try using this construct instead:

$('.popup').magnificPopup({...

Thank you Bloke. I’m really struggling to understand where I’m supposed to put this. I guess it goes into the “head” form…?

<!-- JPF trying to work out where to put this - Magnific Popup CSS -->
<!-- Magnific Popup core CSS file -->
<link rel="stylesheet" href="<txp:site_url />assets/css/magnific-popup.css"> 

<!-- jQuery 1.7.2+ or Zepto.js 1.0+ -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 

<!-- Magnific Popup core JS file -->
<script src="<txp:site_url />assets/js/jquery.magnific-popup.js"></script>

<script>
$('.popup').magnificPopup({
  delegate: 'a',
  type: 'image',
  gallery: { 
    enabled: true 
  }
});


</script>

Anyway, that’s where I’ve put it for now. But I’m still getting the same effect on the page: click on an image and I go to its URL without any kind of clickthrough to other images.

Can anybody recommend a really simple place for me to learn about scripts/JS stuff? I look at the Magnific documentation and I’m not at all clear what the difference is between the bits of HTML that seem familiar, eg:

<a href="path-to-file.html" class="ajax-popup-link">Show inline popup</a>

and the code that looks very strange to me, often starting with dollar signs and a variety of brackets on different lines (why??), such as this:

$('.ajax-popup-link').magnificPopup({
  type: 'ajax'
});

I’m ok on HTML and on Textile markup but this is totally baffling.

Thank you again.


Strictly Amateur

Offline

Board footer

Powered by FluxBB