Tag: shuffle

为同一个类的divs随机添加的类

我有几个同一类的div。 我想随机地为每个div添加一个(不同的)类,但是没有在彼此之后重复添加类。 这是我的示例html: some text here some other text here some more text here some more text here some more text here 应该添加的示例css: .addedclass1 {…} .addedclass2 {…} .addedclass2 {…} .addedclass3 {…} .addedclass4 {…} 我最终会喜欢看到的: some text here some other text here some more text here some more text here some more text here 我有一些随机化添加的类的jquery,但它允许重复: $(document).ready(function() […]

选择随机元素

我正在尝试为我的HTML 5播放器制作一个随机播放按钮。 我的播放器设置如下,以便进入下一首曲目: $(‘.nextbutton’).on(“click”, function(){ var next = $(‘li.playing’).next(); if (!next.length) next = $(‘#stuff ul li’).first(); next.addClass(‘playing’).siblings().removeClass(‘playing’); var title = $(‘a#tunes img’, next).attr(“title”); $(“a.songtitle span”).text(title); var artist = $(‘a#tunes img’, next).attr(“artist”); $(“a.songartist span”).text(artist); audio.load($(‘a#tunes’, next).attr(‘data-src’)); audio.play(); }); 这段代码可以转到下一首歌,但是如何更改它以使其选择随机 元素而不是.next(); ? 感谢您的时间和考虑。 希望你能帮我!

jQuery shuffle表行

我有一个有三列的表: 1 AA 2 BB 3 CC 4 DD 我想要做的是洗牌表行但只有第二和第三列,如下例所示 1 CC 2 AA 3 DD 4 BB 我发现了一个漂亮的插件,可以让桌子行被洗牌 http://www.yelotofu.com/2008/08/jquery-shuffle-plugin/ 但我想保留第一列的默认顺序。 我要么在洗牌后重新排序第一列,要么只是洗牌第二和第三列。 无论哪种方式,有人可以帮我解决这个问题吗?

制作一个Jquery shuffle Gallery

我正在尝试做一个随机播放幻灯片,就像这个网站一样 。 这是一个带有随机播放和淡入淡出的画廊,但我只有这个代码: 你能帮我吗? 我已经处理了shuffles代码,但是他们从一个按钮开始,但我不想要按钮,我想要一个自动画廊,在网站上无限期地重复。