| 1 |
/* |
| 2 |
* Super RSS Reader - v1.2 |
| 3 |
* Included with "Super RSS Reader" Wordpress plugin @since v2.0 |
| 4 |
* Author: Aakash Chakravarthy, www.aakashweb.com |
| 5 |
*/ |
| 6 |
|
| 7 |
(function($){ |
| 8 |
$(document).ready(function(){ |
| 9 |
|
| 10 |
var widget = $('.super-rss-reader-widget'); |
| 11 |
widget.find('.srr-wrap').hide(); |
| 12 |
widget.find('.srr-wrap:first').show(); |
| 13 |
widget.find('.srr-tab-wrap li:first').addClass('srr-active-tab'); |
| 14 |
|
| 15 |
$('.srr-tab-wrap li').click(function(){ |
| 16 |
var id = $(this).attr('data-tab'); |
| 17 |
var parent = $(this).parent().parent(); |
| 18 |
|
| 19 |
$(this).parent().children('li').removeClass('srr-active-tab'); |
| 20 |
$(this).addClass('srr-active-tab'); |
| 21 |
|
| 22 |
parent.find('.srr-wrap').hide(); |
| 23 |
|
| 24 |
$srrTicker = parent.find('.srr-wrap[data-id=' + id + ']'); |
| 25 |
$srrTicker.show(); |
| 26 |
|
| 27 |
if($srrTicker.height() == 0){ |
| 28 |
var visibleItems = $srrTicker.data('visible'); |
| 29 |
var tempHeight = $srrTicker.find('.srr-item:first-child').outerHeight() * visibleItems; |
| 30 |
$srrTicker.height(tempHeight); |
| 31 |
} |
| 32 |
|
| 33 |
}); |
| 34 |
|
| 35 |
// Add the ticker to the required elements |
| 36 |
$('.srr-vticker').each(function(){ |
| 37 |
var visible = $(this).attr('data-visible'); |
| 38 |
var interval = $(this).attr('data-speed'); |
| 39 |
var height = (parseInt(visible) <= 20 ? 'auto' : visible ); |
| 40 |
var ticker = $(this).easyTicker({ |
| 41 |
'visible': visible, |
| 42 |
'height': height, |
| 43 |
'interval': interval |
| 44 |
}); |
| 45 |
}); |
| 46 |
|
| 47 |
}); |
| 48 |
}(jQuery)); |