Coder Social home page Coder Social logo

Comments (13)

danceash avatar danceash commented on May 13, 2024

另外,还遇到一个问题,就是我在页面内加上了连接,连接到http://www.baidu.com,再返回的时候,有链接的页面的右侧页面为空,是没有办法往左滑动的,当向右滑动再返回有链接页面的时候,其右侧页面又出现了,不清楚是什么问题导致的,

from islider.

xieyu33333 avatar xieyu33333 commented on May 13, 2024

你好, 使用islider.slideIndex就可以得到索引值

from islider.

danceash avatar danceash commented on May 13, 2024

你好,非常感谢,这个我用了一下,没有问题了。但还有另一种情况,就是页面跳转再返回后,使用islider.slideTo(i);跳转到有链接的那张图片后,会出现右侧没有图片的情况。具体情况是
onslidechange:function(){
history.pushState(null,'New Page', '#index='+islider.sliderIndex);
}给每个页面添加唯一的url,在当前页面添加链接,比如连接到http://www.baidu.com,再回退,使用islider.slideTo(i);跳转到链接页,会出现右侧没有图片,左侧有,滑动到左侧页面,再返回,就可以看到链接页右侧的页面了,希望您能帮我看一下是什么原因导致的,谢谢!

from islider.

xieyu33333 avatar xieyu33333 commented on May 13, 2024

islider会生成3个<li>容器,你检查一下右侧对应的li内是否有内容,如果有,检查一下是否被置为了visibility:hidden。

from islider.

danceash avatar danceash commented on May 13, 2024

嗯,我看一下,右侧对应的li中visibility:visible的,但是是一个空的li,但是右侧的li中应该是有数据的,

from islider.

xieyu33333 avatar xieyu33333 commented on May 13, 2024

那你需要打断点看一下下面这段代码,看看是否正确执行
if ( Math.abs(n) > 1) {
this._renderItem(els[0], idx - 1);
this._renderItem(els[2], idx + 1);
} else if (Math.abs(n) === 1) {
this._renderItem(sEle, idx + n);
}

from islider.

danceash avatar danceash commented on May 13, 2024

正常情况下都是执行else语句,但是从连接返回来,使用islider.slideTo(i)之后,执行的if语句,是这里的问题吗?

from islider.

xieyu33333 avatar xieyu33333 commented on May 13, 2024

有可能,感觉问题描述的不是特别清楚,如果有可以访问的地址的话可以看一下。

from islider.

danceash avatar danceash commented on May 13, 2024

http://statics.witmob.com/two/index.html,这是链接,东西做的很粗糙,请不要介意,在第三页有一个文字链接,aaaaaaa,点击之后会跳转到baidu首页,然后再点击返回,返回到第3页,就会看不到右侧的页面了,通过查看元素也可以发现,第一个li里面是空的,没有数据

from islider.

wtcsy avatar wtcsy commented on May 13, 2024

lz你好
正在学习这个效果
请教个问题
如果不是当前正中间的图片
他的translateZ是怎么算出来的,让图片正好在容器的边缘???

from islider.

danceash avatar danceash commented on May 13, 2024

朋友你好,关于iSlider里面详细的逻辑,我还没有仔细研究,目前处于刚会用的阶段,你的这个问题我也不清楚,还是请作者来回答吧,抱歉了

from islider.

xieyu33333 avatar xieyu33333 commented on May 13, 2024

你应该先获取location里的index值,然后再new iSlider,让initIndex等于index,另外建议你使用新版本,你使用的这个版本应该没有加入initIndex这个参数

from islider.

danceash avatar danceash commented on May 13, 2024

作者说的对,我的iSlider确实不是最新版本,因为这不是我开始的一个项目,所以没有考虑到这一点,给作者添麻烦了,很抱歉。按照作者上面给出的方法,问题完美解决,非常感谢作者,帮了我很大的忙,谢谢!

from islider.

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.