各スライドに直接リンクできるように、各スライドの一意の名前を使用するようにjQueryCycleを取得しようとしています。私はこれをmalsupsサイトで見つけました:http://jquery.malsup.com/cycle/perma2.html
それを私のデモに取り入れようとしましたが、役に立たなかったので、何が間違っているのかわかりませんか?
デモ:http: //jsbin.com/uviram/1
私がそれに行っても、それでも私は..http://jsbin.com/uviram/1#slide2
につながりますhttp://jsbin.com/uviram/1#slide1
$(function() {
var h,
hash = window.location.hash,
hashes = {},
index = 0;
$('.slideshow slide').each(function(i) {
h = $(this).data('hash');
hashes[h] = i;
});
if (hash)
index = hashes[hash.substring(1)] || index;
$('.slideshow').cycle({
fx: 'scrollHorz',
timeout: 0,
prev: $('.prev'),
next: $('.next'),
after: function(curr,next,opts) {
h = $(this).data('hash');
window.location.hash = h;
}
});
});