- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试向名为 Tiny Carousel 的 slider 插件添加淡入淡出过渡。 .我已经采取了示例演示和 re-styled it here (抱歉使用了 2 个相同的占位符图像)。不幸的是,唯一可用的过渡是幻灯片动画;看起来有点奇怪。我的 jQuery 技能很弱,但是..
“有人知道如何操纵 tinycarousel.js 以允许在幻灯片之间进行渐进和渐出过渡吗?”
JS -
(function ($) {
$.tiny = $.tiny || {};
$.tiny.carousel = {
options: {
start: 1,
display: 1,
axis: 'x',
controls: true,
pager: false,
interval: false,
intervaltime: 3000,
rewind: false,
animation: false,
duration: 1000,
callback: null
}
};
$.fn.tinycarousel = function (options) {
var options = $.extend({}, $.tiny.carousel.options, options);
this.each(function () {
$(this).data('tcl', new Carousel($(this), options));
});
return this;
};
$.fn.tinycarousel_start = function () {
$(this).data('tcl').start();
};
$.fn.tinycarousel_stop = function () {
$(this).data('tcl').stop();
};
$.fn.tinycarousel_move = function (iNum) {
$(this).data('tcl').move(iNum - 1, true);
};
function Carousel(root, options) {
var oSelf = this;
var oViewport = $('.viewport:first', root);
var oContent = $('.overview:first', root);
var oPages = oContent.children();
var oBtnNext = $('.next:first', root);
var oBtnPrev = $('.prev:first', root);
var oPager = $('.pager:first', root);
var iPageSize, iSteps, iCurrent, oTimer, bPause, bForward = true,
bAxis = options.axis == 'x';
function initialize() {
iPageSize = bAxis ? $(oPages[0]).outerWidth(true) : $(oPages[0]).outerHeight(true);
var iLeftover = Math.ceil(((bAxis ? oViewport.outerWidth() : oViewport.outerHeight()) / (iPageSize * options.display)) - 1);
iSteps = Math.max(1, Math.ceil(oPages.length / options.display) - iLeftover);
iCurrent = Math.min(iSteps, Math.max(1, options.start)) - 2;
oContent.css(bAxis ? 'width' : 'height', (iPageSize * oPages.length));
oSelf.move(1);
setEvents();
}
function setEvents() {
if (options.controls && oBtnPrev.length > 0 && oBtnNext.length > 0) {
oBtnPrev.click(function () {
oSelf.move(-1);
return false;
});
oBtnNext.click(function () {
oSelf.move(1);
return false;
});
}
if (options.interval) {
root.hover(oSelf.stop, oSelf.start);
}
if (options.pager && oPager.length > 0) {
$('a', oPager).click(setPager);
}
};
function setButtons() {
if (options.controls) {
oBtnPrev.toggleClass('disable', !(iCurrent > 0));
oBtnNext.toggleClass('disable', !(iCurrent + 1 < iSteps));
}
if (options.pager) {
var oNumbers = $('.pagenum', oPager);
oNumbers.removeClass('active');
$(oNumbers[iCurrent]).addClass('active');
}
};
function setPager(oEvent) {
if ($(this).hasClass('pagenum')) {
oSelf.move(parseInt(this.rel), true);
}
return false;
};
function setTimer() {
if (options.interval && !bPause) {
clearTimeout(oTimer);
oTimer = setTimeout(function () {
iCurrent = iCurrent + 1 == iSteps ? -1 : iCurrent;
bForward = iCurrent + 1 == iSteps ? false : iCurrent == 0 ? true : bForward;
oSelf.move(bForward ? 1 : -1);
}, options.intervaltime);
}
};
this.stop = function () {
clearTimeout(oTimer);
bPause = true;
};
this.start = function () {
bPause = false;
setTimer();
};
this.move = function (iDirection, bPublic) {
iCurrent = bPublic ? iDirection : iCurrent += iDirection;
if (iCurrent > -1 && iCurrent < iSteps) {
var oPosition = {};
oPosition[bAxis ? 'left' : 'top'] = -(iCurrent * (iPageSize * options.display));
oContent.animate(oPosition, {
queue: false,
duration: options.animation ? options.duration : 0,
complete: function () {
if (typeof options.callback == 'function') options.callback.call(this, oPages[iCurrent], iCurrent);
}
});
setButtons();
setTimer();
}
};
return initialize();
};
})(jQuery);
html -
<div class="viewport">
<a class="buttons prev" href="#">left</a>
<ul class="overview">
<form method="post" action="" class="jcart">
<fieldset>
<input type="hidden" name="my-item-id" value="ABC-123" />
<input type="hidden" name="my-item-name" value="Soccer Ball" />
<input type="hidden" name="my-item-price" value="25.00" />
<input type="hidden" name="my-item-url" value="" />
<li class="captions">
<h1 class="price">PRICE: $33.25</h1>
<img src="asset/img/picture1.png" />
<h1>SNACKS<span>armband</span></h1>
<h2>buddy what you nibblin on?</h2>
<p>Snackin snack armband for amazing snackin wrist support. When you carryin
this whole state on yo back, you’ll need all the support you can get. word.</p>
<label>Qty:
<input type="text" name="my-item-qty" value="1" size="3" />
</label>
<input type="submit" name="my-add-button" value="add to cart" class="button"
/>
</li>
</fieldset>
</form>
<form method="post" action="" class="jcart">
<fieldset>
<input type="hidden" name="my-item-id" value="ABC-123" />
<input type="hidden" name="my-item-name" value="Soccer Ball" />
<input type="hidden" name="my-item-price" value="25.00" />
<input type="hidden" name="my-item-url" value="" />
<li class="captions">
<h1 class="price">PRICE: $33.25</h1>
<img src="asset/img/picture1.png" />
<h1>SNACKS<span>armband</span></h1>
<h2>buddy what you nibblin on?</h2>
<p>Snackin snack armband for amazing snackin wrist support. When you carryin
this whole state on yo back, you’ll need all the support you can get. word.</p>
<label>Qty:
<input type="text" name="my-item-qty" value="1" size="3" />
</label>
<input type="submit" name="my-add-button" value="add to cart" class="button"
/>
</li>
</fieldset>
</form>
</ul>
<a class="buttons next" href="#">right</a>
</div>
</div>
最佳答案
我的建议是使用原生支持 fadeIn/fadeOut 的循环脚本。
http://jquery.malsup.com/cycle/
通常很简单,默认淡入淡出:$('#slideshowcontainer').cycle();
关于jquery - 如何向微型轮播脚本添加淡入淡出动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10648899/
我似乎对 git 存储库有权限问题。 当我 pull 入一个不是我的 Linux 用户创建的目录时,我出现了这个错误。 fatal: Unable to create '/home/---/.git/
在 Git 中,您可以将给定目录克隆到给定目录: git clone ssh://gitolite@dev.bipper.com:3687/com/bipper/kids/portal 当我运行我们
目前,如果您在分支 V2 中并执行“git pull origin V3”,它会将 V3 merge 到 V2,甚至不会发出警告或提示。这个选项可以以某种方式被阻止吗?我在这里阅读了所有类似的问题,人
我刚开始使用 Oracle 的 Coherence 缓存,我注意到这一点:如果我在缓存中放入一个 ConcurrentHashMap 对象,当我检索它时,我可以看到它被转换为一个普通的 HashMap
看起来我缺少对 git pull 和 git commit 的基本理解,假设我在分支上工作,而它在我更新时被其他开发人员更新了在本地做我的工作。我应该在发出 git pull 之前提交更改,还是应该执
好的。所以我以为我已经舔过了……但现在…… 我有一个项目,其中包含一个来自 GitHub 的小型库作为子模块。在该 super 项目的原始版本中,子模块按预期工作。 但是,我只是克隆了 super 项
使用 Visual Studio Code 中的内置 Git,我看不到将指定的远程分支 pull 入当前分支的方法。我可以这样做吗? 示例:我正在分支 myBranch 上工作,更改已 merge 到
当我尝试提交或 pull 此错误时 Bus error (core dumped) 发生了! 当我用 gdb 调试它时,(gdb git,run commit -a,where) 结果是: mucul
我对默认 Rails Rake 任务的预期用途有点困惑,想咨询一下我是否应该使用 db:reset或编写自定义 Rake 任务。没什么聪明的,只是日常管理,而且我很可能会错过一个明显的文档,因为我是
所以我做了: git reset --hard #commithash # make a bunch of changes, fixes and so on. git add -A git commi
我已使用以下命令成功部署到 firebase 托管应用: firebase init firebase deploy 在这个阶段,我正在执行 git pull 以将 repo 下 pull 到暂存服务
当尝试在 Eclipse 的 git 存储库中 pull (团队|从上下文菜单中 pull )时,出现 Could not get advertised Ref for branch refs/hea
我是一名优秀的程序员,十分优秀!