PDA

View Full Version : Remove feeds from gajaxpausescroller



npc100
11-26-2009, 08:54 PM
1) Script Title: gajaxpausescroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex18/gajaxpausescroller.htm

3) Describe problem:

I use PHP to extract the feeds I want added to the scroller from a MYSQL database.

I can add feeds ok, but I can't see a function that would allow me to remove feeds.

I have tried re-setting the feed to its initial state (before any feeds were added) by writing a function, and calling it when a user clicks the appropriate button:



function removeFeeds() {
this.linktarget=linktarget || "" //link target of RSS entries
this.feedlabels=[] //array holding lables for each RSS feed
this.feedurls=[]
this.feeds=[] //array holding combined RSS feeds' entries from Feed API (result.feed.entries)
this.feedsfetched=0 //number of feeds fetched
}


But it doesn't seem to have any effect.

A separate issue is when I use the 'example2' css, if I add 3 or more feeds, the scroll function no longer works correctly - entries will scroll up and off the screen.

I'm a complete newbie to Javascript, so any pointers would be greatly appreciated!

TIA

Neil

ddadmin
11-26-2009, 10:37 PM
Hmm there's no quick way to remove a feed from the scroller once it's initialized unfortunately. Not to say it's impossible, but thinking about it, the script has to be modified to support reinitialization after having removed the desired feed, which is rather extensive.

As far as the "example2" issue, are you sure this isn't just a case of the container not being tall enough to accommodate all the feeds? By default it's 180px:


#example2{ /*Demo 2 main container*/
width: 550px;
height: 180px;
border: 1px dashed black;
padding: 4px;
background-color: #EEEEEE;
}

npc100
11-27-2009, 11:42 AM
Hi, and thanks for the reply.

I can see how removing an individual feed could be tricky.

Is there an easy way to reset the scroller to a totally empty state where no feeds are there, and to build the feed-list again from scratch?

Everything I have tried leaves me with a 'transferring data from Google' message that never seems to complete.

On the second item, I have increased the height to 400px and added 5 feeds to the scroller. It works for the first few 'scrolls', and then starts to behave erratically, scrolling a page up and out the 'window', closely followed by a 2nd page that comes to halt where it should.

ddadmin
11-27-2009, 07:26 PM
Hmm the issue all comes down to doing this without reloading the page, which is what's difficult. If you're ok with the page reloading, then one way this can be done is by passing some value via the URL parameter string, and based on that selectively load the feeds.

Do you have an example to the problem as far as the height issue?