}
}
- if (mode === 'exclusiveshow') {
+ var showid;
+ if (mode === 'shownext' || mode === 'shownextcycle') {
+ var ids = $(this).data('showid').split(',');
+ console.log(ids);
+ var current = $(this).data('current-showid');
+ console.log(current);
+ if (current === undefined) {
+ showid = ids[0];
+ } else {
+ var idx = ids.indexOf(current) + 1;
+ if (idx === ids.length) {
+ if (mode === 'shownext') {
+ return false;
+ } else {
+ idx = 0;
+ }
+ }
+ showid = ids[idx];
+ }
+ console.log(showid);
+ $(this).data('current-showid', showid);
+ } else {
+ showid = $(this).data('showid');
+ }
+
+ if (mode === 'exclusiveshow' || mode === 'shownext' || mode === 'shownextcycle') {
$('div.link[data-hidden="1"].show').each(function () {
- $this.hidePlacedLink(this);
+ $this.hidePlacedLink(this, (mode === 'shownext' || mode === 'shownextcycle') ? 500 : 0);
});
}
-
var close = $(this).data('showclose');
- $('div.link[data-id$="' + $(this).data('showid') + '"]').each(function () {
+ $('div.link[data-id$="' + showid + '"]').each(function () {
var l = this;
$(l).append('<a href="#" class="linkshowclose ' + close + '"></a>');
$(l).show();
return u.href;
},
- hidePlacedLink: function (p) {
+ hidePlacedLink: function (p, timeout) {
if ($(p).length === 0) {
return;
}
- $(p).hide();
- $(p).removeClass('show');
- $(p).find('.linkshowclose').remove();
+ if (timeout === undefined) {
+ timeout = 0;
+ }
+ setTimeout(function () {
+
+ $(p).removeClass('show');
+ $(p).find('.linkshowclose').remove();
+ setTimeout(function () {
+ $(p).hide();
+ }, 1000)
+ }, timeout);
},
initLinks: function (pageNr) {