# super-rss-reader/4.0/public/js/script.js

Super RSS Reader – Add attractive RSS Feed Widget, version 4.0. 47 lines.

- Page: https://pluginprobe.com/plugins/super-rss-reader/4.0/code/public/js/script.js
- Raw: https://pluginprobe.com/plugins/super-rss-reader/4.0/raw/public/js/script.js
- Modified: 2020-10-25T17:13:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/super-rss-reader/4.0/code/public/js/script.js#L10-L20`.

```javascript
/*
 * Super RSS Reader, WordPress plugin
 * Aakash Chakravarthy, www.aakashweb.com
 */

(function($){
$(document).ready(function(){
    
    var widget = $('.srr-main');
    widget.find('.srr-wrap').hide();
    widget.find('.srr-wrap:first').show();
    widget.find('.srr-tab-wrap li:first').addClass('srr-active-tab');

    $('.srr-tab-wrap li').click(function(){
        var id = $(this).attr('data-tab');
        var parent = $(this).parent().parent();
        
        $(this).parent().children('li').removeClass('srr-active-tab');
        $(this).addClass('srr-active-tab');
        
        parent.find('.srr-wrap').hide();

        $srrTicker = parent.find('.srr-wrap[data-id=' + id + ']');
        $srrTicker.show();
        
        if($srrTicker.height() == 0){
            var visibleItems = $srrTicker.data('visible');
            var tempHeight = $srrTicker.find('.srr-item:first-child').outerHeight() * visibleItems;
            $srrTicker.height(tempHeight);
        }

    });

    // Add the ticker to the required elements
    $('.srr-vticker').each(function(){
        var visible = $(this).attr('data-visible');
        var interval = $(this).attr('data-speed');
        var height = (parseInt(visible) <= 20 ? 'auto' : visible );
        var ticker = $(this).easyTicker({
            'visible': visible,
            'height': height,
            'interval': interval
        });
    });
    
});
}(jQuery));
```
