Boas-vindas ao Power Pixel

Junte-se a comunidade! Crie o seu próprio conteúdo, e faça amizades.EntrarCriar uma conta

Velocidade de Slideshow

4 participantes

Pyro Pyro  • Seg 2 Dez 2013 - 19:56

Velocidade de Slideshow Empty Velocidade de Slideshow Seg 2 Dez 2013 - 19:56

Qual é minha questão:
ola atodos, hoje fiz um slide com este tutorial: [Tens de ter uma conta e sessão iniciada para poderes visualizar este link] , só que a passagem de um slide para outro está muito rápida e eu gostaria de diminuir a velocidade, como faço isso?

Endereço do meu fórum:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Versão:
PunBB

[S]herlock H. [S]herlock H.  • Seg 2 Dez 2013 - 20:07

Velocidade de Slideshow Empty Re: Velocidade de Slideshow Seg 2 Dez 2013 - 20:07

Saudações!

Por você já te instalado, por gentileza, me passe o código que está utilizando atualmente.

Até mais.

Daemon Daemon  • Seg 2 Dez 2013 - 20:51

Velocidade de Slideshow Empty Re: Velocidade de Slideshow Seg 2 Dez 2013 - 20:51

O código javascript do tutorial, troque por este:
Código:
(function (a) {
    var b = function (p, G) {
        var d = a.extend({}, a.fn.nivoSlider.defaults, G);
        var e = {
            currentSlide: 0,
            currentImage: "",
            totalSlides: 0,
            running: false,
            paused: false,
            stop: false
        };
        var f = a(p);
        f.data("nivo:vars", e);
        f.css("position", "relative");
        f.addClass("nivoSlider");
        var g = f.children();
        g.each(function () {
            var u = a(this);
            var r = "";
            if (!u.is("img")) {
                if (u.is("a")) {
                    u.addClass("nivo-imageLink");
                    r = u
                }
                u = u.find("img:first")
            }
            var s = u.width();
            if (s == 0) {
                s = u.attr("width")
            }
            var t = u.height();
            if (t == 0) {
                t = u.attr("height")
            }
            if (s > f.width()) {
                f.width(s)
            }
            if (t > f.height()) {
                f.height(t)
            }
            if (r != "") {
                r.css("display", "none")
            }
            u.css("display", "none");
            e.totalSlides++
        });
        if (d.randomStart) {
            d.startSlide = Math.floor(Math.random() * e.totalSlides)
        }
        if (d.startSlide > 0) {
            if (d.startSlide >= e.totalSlides) {
                d.startSlide = e.totalSlides - 1
            }
            e.currentSlide = d.startSlide
        }
        if (a(g[e.currentSlide]).is("img")) {
            e.currentImage = a(g[e.currentSlide])
        } else {
            e.currentImage = a(g[e.currentSlide]).find("img:first")
        }
        if (a(g[e.currentSlide]).is("a")) {
            a(g[e.currentSlide]).css("display", "block")
        }
        f.css("background", 'url("' + e.currentImage.attr("src") + '") no-repeat');
        f.append(a('<div class="nivo-caption"><p></p></div>').css({
            display: "none",
            opacity: d.captionOpacity
        }));
        var h = function (t) {
            var r = a(".nivo-caption", f);
            if (e.currentImage.attr("title") != "" && e.currentImage.attr("title") != undefined) {
                var s = e.currentImage.attr("title");
                if (s.substr(0, 1) == "#") {
                    s = a(s).html()
                }
                if (r.css("display") == "block") {
                    r.find("p").stop().fadeOut(t.animSpeed, function () {
                        a(this).html(s);
                        a(this).stop().fadeIn(t.animSpeed)
                    })
                } else {
                    r.find("p").html(s)
                }
                r.stop().fadeIn(t.animSpeed)
            } else {
                r.stop().fadeOut(t.animSpeed)
            }
        };
        h(d);
        var i = 0;
        if (!d.manualAdvance && g.length > 1) {
            i = setInterval(function () {
                q(f, g, d, false)
            }, d.pauseTime)
        }
        if (d.directionNav) {
            f.append('<div class="nivo-directionNav"><a class="nivo-prevNav">' + d.prevText + '</a><a class="nivo-nextNav">' + d.nextText + "</a></div>");
            if (d.directionNavHide) {
                a(".nivo-directionNav", f).hide();
                f.hover(function () {
                    a(".nivo-directionNav", f).show()
                }, function () {
                    a(".nivo-directionNav", f).hide()
                })
            }
            a("a.nivo-prevNav", f).live("click", function () {
                if (e.running) {
                    return false
                }
                clearInterval(i);
                i = "";
                e.currentSlide -= 2;
                q(f, g, d, "prev")
            });
            a("a.nivo-nextNav", f).live("click", function () {
                if (e.running) {
                    return false
                }
                clearInterval(i);
                i = "";
                q(f, g, d, "next")
            })
        }
        if (d.controlNav) {
            var k = a('<div class="nivo-controlNav"></div>');
            f.append(k);
            for (var l = 0; l < g.length; l++) {
                if (d.controlNavThumbs) {
                    var m = g.eq(l);
                    if (!m.is("img")) {
                        m = m.find("img:first")
                    }
                    if (d.controlNavThumbsFromRel) {
                        k.append('<a class="nivo-control" rel="' + l + '"><img src="' + m.attr("rel") + '" alt="" /></a>')
                    } else {
                        k.append('<a class="nivo-control" rel="' + l + '"><img src="' + m.attr("src").replace(d.controlNavThumbsSearch, d.controlNavThumbsReplace) + '" alt="" /></a>')
                    }
                } else {
                    k.append('<a class="nivo-control" rel="' + l + '">' + (l + 1) + "</a>")
                }
            }
            a(".nivo-controlNav a:eq(" + e.currentSlide + ")", f).addClass("active");
            a(".nivo-controlNav a", f).live("click", function () {
                if (e.running) {
                    return false
                }
                if (a(this).hasClass("active")) {
                    return false
                }
                clearInterval(i);
                i = "";
                f.css("background", 'url("' + e.currentImage.attr("src") + '") no-repeat');
                e.currentSlide = a(this).attr("rel") - 1;
                q(f, g, d, "control")
            })
        }
        if (d.keyboardNav) {
            a(window).keypress(function (r) {
                if (r.keyCode == "37") {
                    if (e.running) {
                        return false
                    }
                    clearInterval(i);
                    i = "";
                    e.currentSlide -= 2;
                    q(f, g, d, "prev")
                }
                if (r.keyCode == "39") {
                    if (e.running) {
                        return false
                    }
                    clearInterval(i);
                    i = "";
                    q(f, g, d, "next")
                }
            })
        }
        if (d.pauseOnHover) {
            f.hover(function () {
                e.paused = true;
                clearInterval(i);
                i = ""
            }, function () {
                e.paused = false;
                if (i == "" && !d.manualAdvance) {
                    i = setInterval(function () {
                        q(f, g, d, false)
                    }, d.pauseTime)
                }
            })
        }
        f.bind("nivo:animFinished", function () {
            e.running = false;
            a(g).each(function () {
                if (a(this).is("a")) {
                    a(this).css("display", "none")
                }
            });
            if (a(g[e.currentSlide]).is("a")) {
                a(g[e.currentSlide]).css("display", "block")
            }
            if (i == "" && !e.paused && !d.manualAdvance) {
                i = setInterval(function () {
                    q(f, g, d, false)
                }, d.pauseTime)
            }
            d.afterChange.call(this)
        });
        var n = function (v, r, s) {
            for (var t = 0; t < r.slices; t++) {
                var u = Math.round(v.width() / r.slices);
                if (t == r.slices - 1) {
                    v.append(a('<div class="nivo-slice"></div>').css({
                        left: u * t + "px",
                        width: v.width() - u * t + "px",
                        height: "0px",
                        opacity: "0",
                        background: 'url("' + s.currentImage.attr("src") + '") no-repeat -' + (u + t * u - u) + "px 0%"
                    }))
                } else {
                    v.append(a('<div class="nivo-slice"></div>').css({
                        left: u * t + "px",
                        width: u + "px",
                        height: "0px",
                        opacity: "0",
                        background: 'url("' + s.currentImage.attr("src") + '") no-repeat -' + (u + t * u - u) + "px 0%"
                    }))
                }
            }
        };
        var o = function (v, w, x) {
            var r = Math.round(v.width() / w.boxCols);
            var s = Math.round(v.height() / w.boxRows);
            for (var t = 0; t < w.boxRows; t++) {
                for (var u = 0; u < w.boxCols; u++) {
                    if (u == w.boxCols - 1) {
                        v.append(a('<div class="nivo-box"></div>').css({
                            opacity: 0,
                            left: r * u + "px",
                            top: s * t + "px",
                            width: v.width() - r * u + "px",
                            height: s + "px",
                            background: 'url("' + x.currentImage.attr("src") + '") no-repeat -' + (r + u * r - r) + "px -" + (s + t * s - s) + "px"
                        }))
                    } else {
                        v.append(a('<div class="nivo-box"></div>').css({
                            opacity: 0,
                            left: r * u + "px",
                            top: s * t + "px",
                            width: r + "px",
                            height: s + "px",
                            background: 'url("' + x.currentImage.attr("src") + '") no-repeat -' + (r + u * r - r) + "px -" + (s + t * s - s) + "px"
                        }))
                    }
                }
            }
        };
        var q = function (r, s, t, u) {
            var v = r.data("nivo:vars");
            if (v && v.currentSlide == v.totalSlides - 1) {
                t.lastSlide.call(this)
            }
            if ((!v || v.stop) && !u) {
                return false
            }
            t.beforeChange.call(this);
            if (!u) {
                r.css("background", 'url("' + v.currentImage.attr("src") + '") no-repeat')
            } else {
                if (u == "prev") {
                    r.css("background", 'url("' + v.currentImage.attr("src") + '") no-repeat')
                }
                if (u == "next") {
                    r.css("background", 'url("' + v.currentImage.attr("src") + '") no-repeat')
                }
            }
            v.currentSlide++;
            if (v.currentSlide == v.totalSlides) {
                v.currentSlide = 0;
                t.slideshowEnd.call(this)
            }
            if (v.currentSlide < 0) {
                v.currentSlide = v.totalSlides - 1
            }
            if (a(s[v.currentSlide]).is("img")) {
                v.currentImage = a(s[v.currentSlide])
            } else {
                v.currentImage = a(s[v.currentSlide]).find("img:first")
            }
            if (t.controlNav) {
                a(".nivo-controlNav a", r).removeClass("active");
                a(".nivo-controlNav a:eq(" + v.currentSlide + ")", r).addClass("active")
            }
            h(t);
            a(".nivo-slice", r).remove();
            a(".nivo-box", r).remove();
            var w = t.effect;
            if (t.effect == "random") {
                var x = new Array("sliceDownRight", "sliceDownLeft", "sliceUpRight", "sliceUpLeft", "sliceUpDown", "sliceUpDownLeft", "fold", "fade", "boxRandom", "boxRain", "boxRainReverse", "boxRainGrow", "boxRainGrowReverse");
                w = x[Math.floor(Math.random() * (x.length + 1))];
                if (w == undefined) {
                    w = "fade"
                }
            }
            if (t.effect.indexOf(",") != -1) {
                var x = t.effect.split(",");
                w = x[Math.floor(Math.random() * x.length)];
                if (w == undefined) {
                    w = "fade"
                }
            }
            if (v.currentImage.attr("data-transition")) {
                w = v.currentImage.attr("data-transition")
            }
            v.running = true;
            if (w == "sliceDown" || w == "sliceDownRight" || w == "sliceDownLeft") {
                n(r, t, v);
                var y = 0;
                var z = 0;
                var A = a(".nivo-slice", r);
                if (w == "sliceDownLeft") {
                    A = a(".nivo-slice", r)._reverse()
                }
                A.each(function () {
                    var H = a(this);
                    H.css({
                        top: "0px"
                    });
                    if (z == t.slices - 1) {
                        setTimeout(function () {
                            H.animate({
                                height: "100%",
                                opacity: "1.0"
                            }, t.animSpeed, "", function () {
                                r.trigger("nivo:animFinished")
                            })
                        }, 100 + y)
                    } else {
                        setTimeout(function () {
                            H.animate({
                                height: "100%",
                                opacity: "1.0"
                            }, t.animSpeed)
                        }, 100 + y)
                    }
                    y += 50;
                    z++
                })
            } else {
                if (w == "sliceUp" || w == "sliceUpRight" || w == "sliceUpLeft") {
                    n(r, t, v);
                    var y = 0;
                    var z = 0;
                    var A = a(".nivo-slice", r);
                    if (w == "sliceUpLeft") {
                        A = a(".nivo-slice", r)._reverse()
                    }
                    A.each(function () {
                        var H = a(this);
                        H.css({
                            bottom: "0px"
                        });
                        if (z == t.slices - 1) {
                            setTimeout(function () {
                                H.animate({
                                    height: "100%",
                                    opacity: "1.0"
                                }, t.animSpeed, "", function () {
                                    r.trigger("nivo:animFinished")
                                })
                            }, 100 + y)
                        } else {
                            setTimeout(function () {
                                H.animate({
                                    height: "100%",
                                    opacity: "1.0"
                                }, t.animSpeed)
                            }, 100 + y)
                        }
                        y += 50;
                        z++
                    })
                } else {
                    if (w == "sliceUpDown" || w == "sliceUpDownRight" || w == "sliceUpDownLeft") {
                        n(r, t, v);
                        var y = 0;
                        var z = 0;
                        var B = 0;
                        var A = a(".nivo-slice", r);
                        if (w == "sliceUpDownLeft") {
                            A = a(".nivo-slice", r)._reverse()
                        }
                        A.each(function () {
                            var H = a(this);
                            if (z == 0) {
                                H.css("top", "0px");
                                z++
                            } else {
                                H.css("bottom", "0px");
                                z = 0
                            }
                            if (B == t.slices - 1) {
                                setTimeout(function () {
                                    H.animate({
                                        height: "100%",
                                        opacity: "1.0"
                                    }, t.animSpeed, "", function () {
                                        r.trigger("nivo:animFinished")
                                    })
                                }, 100 + y)
                            } else {
                                setTimeout(function () {
                                    H.animate({
                                        height: "100%",
                                        opacity: "1.0"
                                    }, t.animSpeed)
                                }, 100 + y)
                            }
                            y += 50;
                            B++
                        })
                    } else {
                        if (w == "fold") {
                            n(r, t, v);
                            var y = 0;
                            var z = 0;
                            a(".nivo-slice", r).each(function () {
                                var I = a(this);
                                var H = I.width();
                                I.css({
                                    top: "0px",
                                    height: "100%",
                                    width: "0px"
                                });
                                if (z == t.slices - 1) {
                                    setTimeout(function () {
                                        I.animate({
                                            width: H,
                                            opacity: "1.0"
                                        }, t.animSpeed, "", function () {
                                            r.trigger("nivo:animFinished")
                                        })
                                    }, 100 + y)
                                } else {
                                    setTimeout(function () {
                                        I.animate({
                                            width: H,
                                            opacity: "1.0"
                                        }, t.animSpeed)
                                    }, 100 + y)
                                }
                                y += 50;
                                z++
                            })
                        } else {
                            if (w == "fade") {
                                n(r, t, v);
                                var C = a(".nivo-slice:first", r);
                                C.css({
                                    height: "100%",
                                    width: r.width() + "px"
                                });
                                C.animate({
                                    opacity: "1.0"
                                }, t.animSpeed * 2, "", function () {
                                    r.trigger("nivo:animFinished")
                                })
                            } else {
                                if (w == "slideInRight") {
                                    n(r, t, v);
                                    var C = a(".nivo-slice:first", r);
                                    C.css({
                                        height: "100%",
                                        width: "0px",
                                        opacity: "1"
                                    });
                                    C.animate({
                                        width: r.width() + "px"
                                    }, t.animSpeed * 2, "", function () {
                                        r.trigger("nivo:animFinished")
                                    })
                                } else {
                                    if (w == "slideInLeft") {
                                        n(r, t, v);
                                        var C = a(".nivo-slice:first", r);
                                        C.css({
                                            height: "100%",
                                            width: "0px",
                                            opacity: "1",
                                            left: "",
                                            right: "0px"
                                        });
                                        C.animate({
                                            width: r.width() + "px"
                                        }, t.animSpeed * 2, "", function () {
                                            C.css({
                                                left: "0px",
                                                right: ""
                                            });
                                            r.trigger("nivo:animFinished")
                                        })
                                    } else {
                                        if (w == "boxRandom") {
                                            o(r, t, v);
                                            var D = t.boxCols * t.boxRows;
                                            var z = 0;
                                            var y = 0;
                                            var E = c(a(".nivo-box", r));
                                            E.each(function () {
                                                var H = a(this);
                                                if (z == D - 1) {
                                                    setTimeout(function () {
                                                        H.animate({
                                                            opacity: "1"
                                                        }, t.animSpeed, "", function () {
                                                            r.trigger("nivo:animFinished")
                                                        })
                                                    }, 100 + y)
                                                } else {
                                                    setTimeout(function () {
                                                        H.animate({
                                                            opacity: "1"
                                                        }, t.animSpeed)
                                                    }, 100 + y)
                                                }
                                                y += 20;
                                                z++
                                            })
                                        } else {
                                            if (w == "boxRain" || w == "boxRainReverse" || w == "boxRainGrow" || w == "boxRainGrowReverse") {
                                                o(r, t, v);
                                                var D = t.boxCols * t.boxRows;
                                                var z = 0;
                                                var y = 0;
                                                var F = 0;
                                                var W = 0;
                                                var X = new Array;
                                                X[F] = new Array;
                                                var E = a(".nivo-box", r);
                                                if (w == "boxRainReverse" || w == "boxRainGrowReverse") {
                                                    E = a(".nivo-box", r)._reverse()
                                                }
                                                E.each(function () {
                                                    X[F][W] = a(this);
                                                    W++;
                                                    if (W == t.boxCols) {
                                                        F++;
                                                        W = 0;
                                                        X[F] = new Array
                                                    }
                                                });
                                                for (var Y = 0; Y < t.boxCols * 2; Y++) {
                                                    var Z = Y;
                                                    for (var aa = 0; aa < t.boxRows; aa++) {
                                                        if (Z >= 0 && Z < t.boxCols) {
                                                            (function (L, N, O, I, K) {
                                                                var M = a(X[L][N]);
                                                                var J = M.width();
                                                                var H = M.height();
                                                                if (w == "boxRainGrow" || w == "boxRainGrowReverse") {
                                                                    M.width(0).height(0)
                                                                }
                                                                if (I == K - 1) {
                                                                    setTimeout(function () {
                                                                        M.animate({
                                                                            opacity: "1",
                                                                            width: J,
                                                                            height: H
                                                                        }, t.animSpeed / 1.3, "", function () {
                                                                            r.trigger("nivo:animFinished")
                                                                        })
                                                                    }, 100 + O)
                                                                } else {
                                                                    setTimeout(function () {
                                                                        M.animate({
                                                                            opacity: "1",
                                                                            width: J,
                                                                            height: H
                                                                        }, t.animSpeed / 1.3)
                                                                    }, 100 + O)
                                                                }
                                                            })(aa, Z, y, z, D);
                                                            z++
                                                        }
                                                        Z--
                                                    }
                                                    y += 100
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };
        var c = function (t) {
            for (var u, r, s = t.length; s; u = parseInt(Math.random() * s), r = t[--s], t[s] = t[u], t[u] = r) {}
            return t
        };
        var j = function (r) {
            if (this.console && typeof console.log != "undefined") {
                console.log(r)
            }
        };
        this.stop = function () {
            if (!a(p).data("nivo:vars").stop) {
                a(p).data("nivo:vars").stop = true;
                j("Stop Slider")
            }
        };
        this.start = function () {
            if (a(p).data("nivo:vars").stop) {
                a(p).data("nivo:vars").stop = false;
                j("Start Slider")
            }
        };
        d.afterLoad.call(this);
        return this
    };
    a.fn.nivoSlider = function (c) {
        return this.each(function (e, f) {
            var g = a(this);
            if (g.data("nivoslider")) {
                return g.data("nivoslider")
            }
            var d = new b(this, c);
            g.data("nivoslider", d)
        })
    };
    a.fn.nivoSlider.defaults = {
        effect: "random",
        slices: 15,
        boxCols: 8,
        boxRows: 4,
        animSpeed: 800,
        pauseTime: 5000,
        startSlide: 0,
        directionNav: true,
        directionNavHide: true,
        controlNav: true,
        controlNavThumbs: false,
        controlNavThumbsFromRel: false,
        controlNavThumbsSearch: ".jpg",
        controlNavThumbsReplace: "_thumb.jpg",
        keyboardNav: true,
        pauseOnHover: true,
        manualAdvance: false,
        captionOpacity: 0.8,
        prevText: "Prev",
        nextText: "Next",
        randomStart: false,
        beforeChange: function () {},
        afterChange: function () {},
        slideshowEnd: function () {},
        lastSlide: function () {},
        afterLoad: function () {}
    };
    a.fn._reverse = [].reverse
})(jQuery);
Até mais!

Pyro Pyro  • Seg 2 Dez 2013 - 21:05

Velocidade de Slideshow Empty Re: Velocidade de Slideshow Seg 2 Dez 2013 - 21:05

daemon o Jscript que você deu não teve muito resultado( não percebi mudança alguma ), nem aumentando o "pauseTime"

[S]herlock H. [S]herlock H.  • Seg 2 Dez 2013 - 21:43

Velocidade de Slideshow Empty Re: Velocidade de Slideshow Seg 2 Dez 2013 - 21:43

Saudações!

Troque o código da mensagem por este:
Código:

<div style="width:700px;margin:40px auto;">
  <div class="slider-wrapper theme-default">
      <div class="ribbon">
      </div>
      <div id="nivoslider-125" class="nivoSlider" style="width:700px;height:300px;">
                        <img src="http://vipmotorsports.com/wp-content/uploads/2012/06/slide04-700x300.jpg" title="#nivoslider-125-caption-0" alt="" height="300px" width="700px" />
 
                        <img src="http://www.oriongames.com.br/wp-content/uploads/2012/08/Guild-Wars-2-700x300.jpg" title="#nivoslider-125-caption-1" alt="" height="300px" width="700px"/>

                        <img src="http://www.oriongames.com.br/wp-content/uploads/2012/08/Darksiders-II-700x300.jpg" title="#nivoslider-125-caption-2" alt="" height="300px" width="700px"/>
      </div>
  </div>
  <div id="nivoslider-125-caption-0" class="nivo-html-caption">
      Texto 1...
  </div>
  <div id="nivoslider-125-caption-1" class="nivo-html-caption">
      Texto 2 ...
  </div>
  <div id="nivoslider-125-caption-2" class="nivo-html-caption">
      Texto 3 ...
  </div>
  <p>
      <script type="text/javascript">jQuery(window).load(function(){jQuery("#nivoslider-125").nivoSlider({effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:600,pauseTime:6000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:true,keyboardNav:true,pauseOnHover:true,manualAdvance:false});});</script>
  </div>

Pyro Pyro  • Ter 3 Dez 2013 - 8:17

Velocidade de Slideshow Empty Re: Velocidade de Slideshow Ter 3 Dez 2013 - 8:17

opa deu certo clark valeu ai cara o/

[K]oke [K]oke  • Ter 3 Dez 2013 - 8:27

Velocidade de Slideshow Empty Membro Satisfeito! Ter 3 Dez 2013 - 8:27

[sucesso=Tópico Resolvido; e Bloqueado]Membro Satisfeito![/sucesso]Movido para: Arquivo - Pedido de código

Conteúdo patrocinado  • 

Velocidade de Slideshow Empty Re: Velocidade de Slideshow

Permissões neste sub-fórum
Não podes responder a tópicos