Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-02-11 20:43:23

kuro
Member
From: Mexico City | Mérida, Yucatán
Registered: 2005-08-26
Posts: 73
Website

[es-es] Backstretch

He estado jugando con este jQuery app y me ha encantado.

Ahora, lo que quiero hacer es desginar ciertas imágenes para que carguen a mi gusto:

<script>
    // Create an array of images that you'd like to use
    var images = [
        "pot-holder.jpg",
        "coffee.jpg"
    ];

//Aquí quería poner un custom tag para que genere un listado de imágenes

  var images = [
                 <txp:if_article_images>
        	<txp:images break="" sort='field(`ID`,<txp:custom_field name="article_image" />)'>
                </txp:images>
                <txp:if_article_images>

    ];

    // A little script for preloading all of the images
    // It's not necessary, but generally a good idea
    $(images).each(function(){
       $('')[0].src = this; 
    });

    // The index variable will keep track of which image is currently showing
    var index = 0;

    // Call backstretch for the first time,
    // In this case, I'm settings speed of 500ms for a fadeIn effect between images.
    $.backstretch(images[index], {speed: 500});

    // Set an interval that increments the index and sets the new image
    // Note: The fadeIn speed set above will be inherited
    setInterval(function() {
        index = (index >= images.length - 1) ? 0 : index + 1;
        $.backstretch(images[index]);
    }, 5000);
</script>

Ya les iré contando de esta travesía :)

{Edited to add bc.. for better code display. – Uli}

Last edited by uli (2012-02-11 22:19:44)

Offline

#2 2012-02-11 22:26:38

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

Re: [es-es] Backstretch

txp:if_article_images should be txp:if_article_image, and there’s nothing for the txp:images container tag to contain. Hope this helps you enough, because Google translate was a complete mess and neither do I understand the task of this script.


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

Offline

#3 2013-03-07 07:08:49

kuro
Member
From: Mexico City | Mérida, Yucatán
Registered: 2005-08-26
Posts: 73
Website

Re: [es-es] Backstretch

Thanks Uli
I leave that project.. Now i’m going to check the issue

Have a nice day

Offline

#4 2013-06-05 17:18:39

kuro
Member
From: Mexico City | Mérida, Yucatán
Registered: 2005-08-26
Posts: 73
Website

Re: [es-es] Backstretch

uli dijo:

txp:if_article_images should be txp:if_article_image, and there’s nothing for the txp:images container tag to contain. Hope this helps you enough, because Google translate was a complete mess and neither do I understand the task of this script.

Thanks Uli.. i did it and works :)

Have a nice day

Offline

Board footer

Powered by FluxBB