Closed danceash closed 9 years ago
另外,还遇到一个问题,就是我在页面内加上了连接,连接到http://www.baidu.com,再返回的时候,有链接的页面的右侧页面为空,是没有办法往左滑动的,当向右滑动再返回有链接页面的时候,其右侧页面又出现了,不清楚是什么问题导致的,
你好, 使用islider.slideIndex
就可以得到索引值
你好,非常感谢,这个我用了一下,没有问题了。但还有另一种情况,就是页面跳转再返回后,使用islider.slideTo(i);跳转到有链接的那张图片后,会出现右侧没有图片的情况。具体情况是 onslidechange:function(){ history.pushState(null,'New Page', '#index='+islider.sliderIndex); }给每个页面添加唯一的url,在当前页面添加链接,比如连接到http://www.baidu.com,再回退,使用islider.slideTo(i);跳转到链接页,会出现右侧没有图片,左侧有,滑动到左侧页面,再返回,就可以看到链接页右侧的页面了,希望您能帮我看一下是什么原因导致的,谢谢!
islider会生成3个<li>
容器,你检查一下右侧对应的li内是否有内容,如果有,检查一下是否被置为了visibility:hidden。
嗯,我看一下,右侧对应的li中visibility:visible的,但是是一个空的li,但是右侧的li中应该是有数据的,
那你需要打断点看一下下面这段代码,看看是否正确执行 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); }
正常情况下都是执行else语句,但是从连接返回来,使用islider.slideTo(i)之后,执行的if语句,是这里的问题吗?
有可能,感觉问题描述的不是特别清楚,如果有可以访问的地址的话可以看一下。
lz你好 正在学习这个效果 请教个问题 如果不是当前正中间的图片 他的translateZ是怎么算出来的,让图片正好在容器的边缘???
朋友你好,关于iSlider里面详细的逻辑,我还没有仔细研究,目前处于刚会用的阶段,你的这个问题我也不清楚,还是请作者来回答吧,抱歉了
你应该先获取location里的index值,然后再new iSlider,让initIndex等于index,另外建议你使用新版本,你使用的这个版本应该没有加入initIndex这个参数
作者说的对,我的iSlider确实不是最新版本,因为这不是我开始的一个项目,所以没有考虑到这一点,给作者添麻烦了,很抱歉。按照作者上面给出的方法,问题完美解决,非常感谢作者,帮了我很大的忙,谢谢!
我现在在用iSlider做一个展示的电子杂志,需要对其中特定页面加一些动画特效,所以想在切到某一页时,知道其在动画中是第几也,也就是页码数i,再配合islider.slideTo(i);即可切到这一页,请问有什么方法吗?