Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2011-03-25 01:26:39
- ajw-art
- Member
- Registered: 2010-02-10
- Posts: 33
Re: Using Ajax with Textpattern Articles
If that is the case, you can either only attach them once on first page load and then call just the cycle ‘kickoff’ script each subsequent time, or you could try and cancel all events (I forget the name of the function) and reload them each time.
I get the gist of your statement, but I’m not sure how to implement it. Do you mean create a function that calls all the captions then cycles through them?
In the meantime, I’ve gone through a long (long) list of attempts to solve this rotating caption thing— I tried using event.stopPropagation, various combinations of .die() .unbind() .remove() and .destroy(), and destroying the cycle plugin itself on each call to no avail. I’m sure I’m missing something obvious, but the project deadline is tomorrow so I’m tearing my hair out. This is exactly why I try and stick to the design side of things.
<!--calls jquery cycle after smd_ajax pulls in the content-->
function ajaxcycle(){
$('.caption').empty().remove();
$('#content article').append('<span class="caption"></span>');
$('#full-wrap').cycle('destroy').cycle({
before: onBefore
});
function onBefore() {
$('.caption')
.html('Opposite: ' + this.alt);
};
var cappy = $('.caption').html();
};
Offline
#17 2011-03-25 16:32:25
- qp2wd
- Member
- Registered: 2011-01-11
- Posts: 24
Re: Using Ajax with Textpattern Articles
Fixed it! Well, not exactly. I ended up using smd_gallery’s handy dandy {alt} tag to create a psuedo-caption over the image. So it works in that the correct info now shows for each image, but I can’t position it in the same place that I wanted the caption in before since the div wrapping the cycled images has position:relative. Ah well.
Offline
Re: Using Ajax with Textpattern Articles
Hi Stef,
I’m playing with your plugin which is great but it doesn’t really works for me as I need to keep the url’s and the backward button working… It could be great to make your plugin work with history, isn’t it?
Last edited by NicolasGraph (2013-07-04 14:37:47)
Offline
Re: Using Ajax with Textpattern Articles
NicolasGraph wrote:
It could be great to make your plugin work with history
It’s noted as a ToDo item in the code, yes. Integration with a jQuery history plugin should be feasible. Just need to find time to actually look into it.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
Offline