PDA

View Full Version : Feature Content Slider 2.4 - content dissappearing



mrgrotey
08-31-2010, 08:01 AM
http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm


Hi people, I have used the Featured Content Slider for a local football teams webpage but I have a problem where every so often the content will go blank.

This happens after 10 or so clicks of the tabs and it happens both in IE7 and FF3.

Please see the webpage below. I have used the script on both the 1st and 2nd team league on the front page, and the profile pages

Here is the profile page. It will load fine, all of the profiles do (roll over the 'TEAMS' tab at the top to select different teams/management .etc

http://www.trethomasbluebirds.co.uk/1st_team.php

they all load fine but after clicking maybe 10 names and then going to management all the profile info vanishes. It doesnt come back on a refresh or a Ctrl+F5 full refresh.
The only way to get it back is to completely close down Internet Explorer and start it up again.



Does anyone have any idea of whats going on? I really like this script and done want to resort to having a separate page for every person. One page for the whoel team is so much nicer.
I am using a php include tag to link to an external html page as the person filling these things in doesnt know any web language at all so im keeping him away from as much as possible.

Could it be the php include tag that is causing the conflict with this script?


Oh and one mroe thing once the profiles vanish then so does the league on the front page.

jscheuer1
08-31-2010, 10:30 AM
You have enablepersist set to true here in the contentslider.js file:


//** Featured Content Slider script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 2nd, 08'- Script rewritten and updated to 2.0.
//** June 12th, 08'- Script updated to v 2.3, which adds the following features:
//1) Changed behavior of script to actually collapse the previous content when the active one is shown, instead of just tucking it underneath the later.
//2) Added setting to reveal a content either via "click" or "mouseover" of pagination links (default is former).
//3) Added public function for jumping to a particular slide within a Featured Content instance using an arbitrary link, for example.

//** July 11th, 08'- Script updated to v 2.4:
//1) Added ability to select a particular slide when the page first loads using a URL parameter (ie: mypage.htm?myslider=4 to select 4th slide in "myslider")
//2) Fixed bug where the first slide disappears when the mouse clicks or mouses over it when page first loads.

var featuredcontentslider={

//3 variables below you can customize if desired:
ajaxloadingmsg: '<div style="margin: 20px 0 0 20px"><img src="loading.gif" /> Fetching slider Contents. Please wait...</div>',
bustajaxcache: true, //bust caching of external ajax page after 1st request?
enablepersist: true, //persist to last content viewed when returning to page?

That enables any given page, when reloaded or returned to in the same session, to display the content that it last had.

However, this is based upon a cookie whose name is based upon the id used for the slider. And you have the same id for all of your sliders.

The management slider is much shorter than the team sliders. If the team remembers a slider position above 4, there will be no content to show on the management page.

You can either set the above highlighted value to false, or give each of your sliders unique id's.

If the latter, be aware that the cookie will persist until the end of the browser session. If you have a cookie hanging around for management that's above 4, there will still be a problem until you close all instances of the browser or clear the cookies.

The id's are set in the init:


<script type="text/javascript">

featuredcontentslider.init({
id: "slider2", //id of main slider DIV
contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
toc: "markup", //Valid values: "#increment", "markup", ["label1", "label2", etc]
nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide.
revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
enablefade: [false, 0.1], //[true/false, fadedegree]
autorotate: [false, 3000], //[true/false, pausetime]
onChange: function(previndex, curindex){ //event handler fired whenever script changes slide
//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
}
})

</script>

Changing it there so that each slider is unique will work. But you also need to change it in the markup for each slider to match, ex:


<div id="slider2" class="sliderwrapper" align="center">


<!-- ----------------------------------- MANAGEMENT PROFILE START ----------------------------------- -->

<div class="contentdiv" align="center">
<table border="0" width="500px">
<tr>
<td width="350px"align="left">
<br>
<br>
<h1>Name:</h1>

<!----------- ENTER PLAYER'S NAME BELOW ----------->
Paul Stree

mrgrotey
08-31-2010, 02:31 PM
My god you people are clever! Well done for an amazing job finding that one. I changed it to false, I never really wanted the last tab to be remembered anyway.

Thanks so much, I was almost going to resort to creating a separate page for each profile! :)

Michael