Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.showtext').text($('.hiddentext').first('td:first').text());
- $('.showtext').html($('.highlighted .hiddentext').html());
- $('.showtext').html($nextCol.find('.hiddentext').html());
- $('.showtext').html($prevCol.find('.hiddentext').html());
- var $currCol = $('.highlighted'); //to get the current column
- $('.race strong').text($currCol.closest('.highlighted').first('td:first').text());
- $('.showtext').text($('.hiddentext').first('td:first').text());
- $('.showtext').text($nextCol.find('.hiddentext').text());
- $('.showtext').html($nextCol.find('.hiddentext').html());
- <td class="visible" id="r2">
- <span class="hiddentext">Race 2<br />Santa Fe 12:00</span>
- <strong><a href="#" title="Race number 1">R2</a></strong>
- </td>
- <td class="visible" id="r2" data-text="Race 2<br />Santa Fe 12:00">
- <a href="#" title="Race number 1">R2</a>
- </td>
- var hiddenText = $nextCol.data("text");
- $(".next").click(function(e){
- e.preventDefault();
- var $nextCol = $('.highlighted').next('td');
- MoveCursor($nextCol, 'next');
- });
- $(".previous").click(function(e){
- e.preventDefault();
- var $prevCol = $('.highlighted').prev('td');
- MoveCursor($prevCol, 'prev');
- });
- function MoveCursor(col, side) {
- var maxCol = 8;
- if((side === 'next' && col.length != 0) ||
- (side == 'prev' && col.length != 0 && col.index() >= maxCol)) {
- $('.highlighted').removeClass("highlighted");
- col.addClass("highlighted");
- // show current title
- $('.showtext').html(col.data('text'));
- if (col.hasClass("invisible")) {
- col.removeClass("invisible");
- col.addClass("visible");
- var $toRem;
- if(side == 'prev')
- $toRem = col.next('td').next('td').next('td').next('td').next('td').next('td');
- else
- $toRem = $nextCol.prev('td').prev('td').prev('td').prev('td').prev('td').prev('td');
- $toRem.removeClass("visible");
- $toRem.addClass("invisible");
- }
- }
- }
- $('.showtext').html($currCol.find('span.hiddentext').html());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement