Deshabilitar enlaces en 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>

preguntado el 08 de noviembre de 11 a las 19:11

What does the resulting html look like? -

The feed shows up as a basic list. Just like on the example page aquí -

2 Respuestas

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 +'>'

respondido 17 nov., 11:20

correct, but this is raw, why not add new param to control link display or not ? - Mike Castro Demaria

Too late ? We never know .

Add in var default list subheaderlink: false, y subtitletag: 'h3',.

After I modify :

if (options.linkredirect) feedLink = encodeURIComponent(feedLink);
/* update from this */
/* create html link or not */
if (options.subheaderlink) {
    var shlink = '<a href="'+ options.linkredirect + feedLink +'" title="View this feed at '+ feeds.title +'">'+ entry.title +'</a>';
} else {
    /* switch the encap tag */
    if (options.subtitletag) {
        var shlink = '<' + options.subtitletag + ' class="shlink">'+ entry.title +'</' + options.subtitletag + '>';
    } else {
        var shlink = '<p class="shlink">'+ entry.title +'</p>';
    }
}
/* modify the call to get the previous build content */     
rowArray[rowIndex]['html'] = '<'+ options.titletag +'>' + shlink + '</'+ options.titletag +'>'
/* to this */

Espero que esto ayude, Mike

Respondido 14 Feb 14, 03:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.