PDA

View Full Version : Set descript length in Pausing RSS Scroller



backyarder1
06-08-2007, 11:49 AM
1) Script Title: Pausing RSS Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/index.htm

3) Describe problem: I would like to know how to set the description length

Hi. I love this script and it works great. But there is a problem on the blogger side. I can either get the headings of my blog to display or the full description. Until they fix the bug on the blogger size, I thought if I could just set the text length of the message displayed in the RSS scroller, that would solve the problem. I'm sure I just need to add a mslength tag somewhere but I'm not sure where and I don't want to mess up the whole script.

Can someone tell me how to do this?

Thanks

mburt
06-08-2007, 12:13 PM
Are you trying to change the text size or the actual container width?
If you're trying to change the container width, all you have to do is adjust the style on the according DIV tag:

style="width:100px;"

backyarder1
06-08-2007, 12:32 PM
No, I'm not trying to change either one of those things. I want to truncate the actual amount of text that is being retrieved and displayed. The blogger end SHOULD be truncating it to a short description but it is not. I wanted to work around that problem by truncating the length of what is displayed. It seems like there should be a tag called msglength or something like that.

backyarder1
06-08-2007, 12:59 PM
I think what I need is the correct syntax to use in document.write to set the length of the descrip message.

mburt
06-08-2007, 01:22 PM
Try using this at the end of the variable/string:

.toString().substring(0,length);
That will truncate from 0 to the length desired.

backyarder1
06-08-2007, 01:32 PM
Here is the string:
var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'

Would I make it:
var description='<div class="rssdescription">'+unescape(rsscontent.description).substring(0,250)+'</div>'

backyarder1
06-08-2007, 02:29 PM
thanks. That worked for the substring length. Now I just have to figure out why it isn't parsing the html.

backyarder1
06-08-2007, 02:52 PM
I spoke too soon. I don't have the substring variable set exactly write. it is truncating but every now and then throws in a &#37;2. I fixed it so it is parsing the html correctly. That was a dumb mistake.

But still need help setting the substring length if anyone has a second. Probably just a matter of where I have my periods and paranthesis.

var description='<div class="rssdescription">'+unescape(rsscontent.description.substring(0,250))+'</div>'

backyarder1
06-08-2007, 03:51 PM
I've got it all figured out. Thanks. No more help needed.
var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'
var description=description.substring(0,250)+ '....Select title to read more'