Change Slides-Array on Click
-
Hello guys,
I′m stuck in my code, maybe anyone has a hint for me?
You can specify Slides for example on every page/post etc. by using NextGen-Galleries (that′s what I use).
I have a page template which displays posts of a specific category in a special way
(https://thomaspark.me/2012/12/the-itunes-expanding-album-effect-in-css-js/).
Please take a look at this!Now what I want to achieve is that the Supersized-Slides source changes when an image is clicked.
By using Advanced Custom Fields a gallery-path variable is defined for every post on this side. The path variable is called inside the page template inside a post-loop like:
$chosenGalPath = get_custom_field_value("galerie-pfad"); print getAllImagesInDirectory($slideDirectory);
and the Slides-Array is generated correctly f.e. like this:
[ {image : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/1dozikomfort.jpg', title : ' ', thumb : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/thumbs/thumbs_1dozikomfort.jpg', url : ''}, {image : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/2doppelzimmerklassik.jpg', title : ' ', thumb : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/thumbs/thumbs_2doppelzimmerklassik.jpg', url : ''}, {image : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/3doppelzimmerklassik2.jpg', title : ' ', thumb : 'https://www.urlaub-auf-usedom.dev/wp-content/gallery/galerie_fhd_z_doziklas/thumbs/thumbs_3doppelzimmerklassik2.jpg', url : ''} ];
Now how can I get this php output inside my jQuery function as a variable that can be pushed in an array in combination with the post-ID?
(the code and trial above is not on the given linkonly locally)
In short way:
– custom slides-arrays(PHP variable) are dynamically build when page is called (works)
– how to get these variables back to jqueryPlease excuse if my description sounds confusing..that′s what I am right now ??
Any help would be appreciated! Thanks!
- The topic ‘Change Slides-Array on Click’ is closed to new replies.