Giter Site home page Giter Site logo

想个关于steps的问题 about fullpage HOT 6 CLOSED

powy1993 avatar powy1993 commented on August 30, 2024
想个关于steps的问题

from fullpage.

Comments (6)

powy1993 avatar powy1993 commented on August 30, 2024 1

已经增加了一个 data-step-restart 属性 设置为0 就是从0开始

from fullpage.

semi-xi avatar semi-xi commented on August 30, 2024

那样来了个奇葩需求来了。我点击测导航的时候才是从0开始,如果仅仅是从鼠标滚动的这样的方式的话还是按照原来倒序上去的办法,那样我是在点击的时候才去动态增加那个data-step-restart 还是怎么样

from fullpage.

powy1993 avatar powy1993 commented on August 30, 2024

源码 508 行 修改成
if (arguments[1]) resetStep();

from fullpage.

semi-xi avatar semi-xi commented on August 30, 2024

试了下,好像不是很行,而且这样的话就恢复到原来的样子了。

from fullpage.

powy1993 avatar powy1993 commented on August 30, 2024

// 456行
goPage = function(to) {

    var fix = _fix,
        indexOld,
        _effectNow,
        _isNavBar;

    if (options.beforeChange) {
        if (options.beforeChange(indexNow, page[indexNow]) === 'stop') {
            return;
        }
    }

    if (_isLocked                           // make sure translate is already
        || to === indexNow) return;         // don't translate if thispage

    if (options.continuous) {
        to = roundPage(to, 1);
    } else {
        if (to >= pagelen 
            && stepNow[indexNow] >= stepArr[indexNow] 
            || to < 0 
            && stepNow[indexNow] === 0) return;
    }

    _isLocked = true;
    _isNavBar = arguments[1];

    if (!_isNavBar && !checkStep(to - indexNow)) {
        return setTimeout(function() {
            _isLocked = false;
        }, sTime);
    }

    for (_effectNow in effect) {
        resetAndRun[_effectNow](effect[_effectNow], indexNow, to);
    }

    fix += browser.cssCore === '' ? 20  : 0 ;
    indexOld = indexNow;
    indexNow = to;
    if (_isNav) navChange(indexOld, indexNow);
    setTimeout(function() {
        // fix for bug in ie6-9 about z-index
        page[to].className += ' slide'; 
    }, fix);

    setTimeout(function() {

        pageStyle[to][browser.cssCore + 'TransitionDuration'] = sTime + 'ms';
    }, 20);

    setTimeout(function() {

        if (_isNavBar)resetStep();
        replaceClass(page[indexOld], 'current', '');
        replaceClass(page[indexNow], 'slide', 'current');

        if (options.callback) {
            options.callback(indexNow, page[indexNow]);
        }

        _isLocked = false;
    }, sTime + _fix + 120);

}

// 521行

from fullpage.

semi-xi avatar semi-xi commented on August 30, 2024

有联系方式么,还有一个问题想请教的,顺便我在你的代码的beforeChange,callback加上了form,to的参数

from fullpage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.