MyBB Community Forums

Full Version: Need some help modifying this script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
OK so I have no knowledge in JavaScript, and I'm having some difficulty changing a script to make it work like I want. I'm trying to get a content slider, like a image slider, but for normal text content. And I did found something: http://www.dynamicdrive.com/dynamicindex...glider.htm and it works just as I want, except for one thing. Check the demo. See? It doesn't pre-load the content (inside the slideshow), it slides once the page is loaded. And I want the first slide to be pre-loaded. You might need to check the demo a few times to know what I mean.

I've checked the configuration code, and there's nothing I can change to make it pre-load the first slide.
Any ideas on how to modify this? Or do you know any other script like this? I need this so badly. And it doesn't have to look like the one I found, I can perfectly edit the CSS and HTML to my own likings.

So here is an example of what I want: www.maistrafego.pt (click the 'próximo' button. It works like the DynamicDrive script, plus the first slide is pre-loaded, just as I want).

Thanks in advance.
(2010-01-13, 07:14 PM)faviouz Wrote: [ -> ]OK so I have no knowledge in JavaScript, and I'm having some difficulty changing a script to make it work like I want. I'm trying to get a content slider, like a image slider, but for normal text content. And I did found something: http://www.dynamicdrive.com/dynamicindex...glider.htm and it works just as I want, except for one thing. Check the demo. See? It doesn't pre-load the content (inside the slideshow), it slides once the page is loaded. And I want the first slide to be pre-loaded. You might need to check the demo a few times to know what I mean.

I've checked the configuration code, and there's nothing I can change to make it pre-load the first slide.
Any ideas on how to modify this? Or do you know any other script like this? I need this so badly. And it doesn't have to look like the one I found, I can perfectly edit the CSS and HTML to my own likings.

So here is an example of what I want: www.maistrafego.pt (click the 'próximo' button. It works like the DynamicDrive script, plus the first slide is pre-loaded, just as I want).

Thanks in advance.

Seems to be working fine when I view it on the - could be browser related, what browser are you using? Have you tried messing with a value mentioned in the manual demo: Default content selected: 2nd content.

Quote:featuredcontentglider.init({
gliderid: "canadaprovinces", //ID of main glider container
contentclass: "glidecontent", //Shared CSS class name of each glider content
togglerid: "p-select", //ID of toggler container
remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
selected: 0, //Default selected content index (0=1st)
persiststate: false, //Remember last content shown within browser session (true/false)?
speed: 500, //Glide animation duration (in milliseconds)
direction: "downup", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
autorotate: true, //Auto rotate contents (true/false)?
autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
})

Change 0 after selected: to whatever element you want in your list - 0 for the 1st, 1 for the 2nd, and so on.