addLinks: function (pages) {
pages = pages.map(function (x) {
+ if (x === '-') {
+ return '-';
+ }
return parseInt(x);
});
var nbPages = sectionPages.length;
var i = 0;
$.each(sectionPages, function (k, value) {
- if (value % 2 === 1) {
- value--;
+ if (value !== '-') {
+ console.log(value);
+ if (value % 2 === 1) {
+ value--;
+ }
+ $this.links.push({
+ css: {height: (100 / nbPages) + '%', top: (100 / nbPages * i) + '%'},
+ page: parseInt(value),
+ index: index,
+ id: 'o' + index
+ });
}
- $this.links.push({
- css: {height: (100 / nbPages) + '%', top: (100 / nbPages * i) + '%'},
- page: parseInt(value),
- index: index,
- id: 'o' + index
- });
i++;
index++;
});
var commoncss = {};
commoncss.width = (100 * (this.linkWidth / this.naturalDimensions.width)) + "%";
commoncss.left = (-100 * (this.margin / this.naturalDimensions.width)) + "%";
- console.log(commoncss);
$(this.links).each(function (k, v) {
var l = $('<a class="tablink" />');