Search code examples
jqueryrssmobile-website

Disabling links in zRSSFeed


I'm using the zRSSFeed plugin to display a few different feeds in a mobile web app that I am designing. These feeds aren't typical feeds that the user needs to click through to get more info. Most of the info is contained in the headline and snippet so I would like to disable the headline links so they don't inadvertently click them while scrolling the list.

Here is the script that loads the feeds:

<script type="text/javascript">
    $(document).ready(function() {
        setRSSFeed('#menu');    

        $('#menu').change(function() {
            setRSSFeed(this)
        });

        function setRSSFeed(obj) {
            var feedurl = $('option:selected', obj).val();

            if (feedurl) {
                $('#rss').rssfeed(feedurl, {
                    limit: 20
                });
            }
        }
    });
</script>

Solution

  • I was making this a lot more difficult than it needed to be.

    In the zRSSFeed js file the code for creating the row is:

        // Add feed row
        html += '<li class="rssRow '+row+'">' + 
                '<'+ options.titletag +'><a href="'+ entry.link +'" title="View this feed at '+ feeds.title +'" target="'+ options.linktarget +'">'+ entry.title +'</a></'+ options.titletag +'>'
    

    I just removed the href tag.

        // Add feed row
        html += '<li class="rssRow '+row+'">' + 
                '<'+ options.titletag +'><a title="View this feed at '+ feeds.title +'" target="'+ options.linktarget +'">'+ entry.title +'</a></'+ options.titletag +'>'