Simple News Slider

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Locked
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Simple News Slider

Post by Dr.CSS »

The simplest most basic news slider using the cycle script...

In the <head> of page template...

<__script__ type="text/javascript" src="uploads/jq/jquery162.js"></__script>
<__script__ type="text/javascript" src="uploads/jq/cycle.js"></__script>
<__script__ type="text/javascript">{literal}
$(document).ready(function() {
$('#newsslider').cycle({
fx: 'scrollUp'
});
});{/literal}
</__script>

News Summary template...

<!-- Start News Display Template -->
**********************
<div id='newsslider'>
{foreach from=$items item=entry}
<div class="NewsSummary">

********** normal news calls******************

</div>
{/foreach}
</div>
<!-- End News Display Template -->

See it here...

http://dezertdesign.com/drippy.html
User avatar
manuel
Power Poster
Power Poster
Posts: 353
Joined: Fri Nov 30, 2007 9:15 am

Re: Simple News Slider

Post by manuel »

Hi Dr.CSS,

Thanks for sharing, seems great!
I'm looking forward to testing the various effects for fun but i guess the "cleanest" one to use will indeed be the scrollUp one :)

Greetings,
Manuel
Do you like your open source cms? Buy from the CMSMS partners || Donate
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Simple News Slider

Post by elkman »

Hi Dr. CSS,

Great idea! I was able to convert it to make a more useful quotes scroller.

Thank you for sharing!!!
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Simple News Slider

Post by elkman »

I can't seem to find the correct line of code in the jQuery to slow the scrolling speed down. Can anyone assist?

Thanks!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Simple News Slider

Post by Rolf »

elkman wrote:I can't seem to find the correct line of code in the jQuery to slow the scrolling speed down.
Have you looked here
http://malsup.com/jquery/cycle/options.html?

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Simple News Slider

Post by elkman »

Hi Rolf,

Yes, I did look here and tried several modifications of the "Speed" and "Timeout" functions without viewing any change to the scrolling speed.

Code: Select all

    speed:         1000,  // speed of the transition (any valid fx speed value) 
    speedIn:       null,  // speed of the 'in' transition 
    speedOut:      null,  // speed of the 'out' transition 
    startingSlide: 0,     // zero-based index of the first slide to be displayed 
    sync:          1,     // true if in/out transitions should occur simultaneously 
    timeout:       4000,  // milliseconds between slide transitions (0 to disable auto advance) 
I've also tried changing it here:

Code: Select all

<__script__ type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></__script>
<__script__ type="text/javascript" src="uploads/jq/cycle.js"></__script>
<__script__ type="text/javascript">{literal}
$(document).ready(function() {
$('#newsslider').cycle({
fx: 'scrollUp'
});
});{/literal}
</__script>
as shown in the example located here: http://jquery.malsup.com/cycle/begin.html

I believe it's here but changing timeout: to 12000 caused no change in the scrolling speed. Any ideas?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Simple News Slider

Post by Rolf »

Just checked, I use "timeout" for timing the time to display.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Simple News Slider

Post by elkman »

Thanks for the feedback Rolf. I have changed the "timeout" multiple times now with apparently no effect on the scrolling speed.

On the malsup forum it was suggested to try the "easing". I am now wondering if my problem is caused due to using the Showtime module and the Cycle JQuery on the same page. Perhaps they are interfering with each other.

Thanks again for your response. It is appreciated!

Elkman
elkman
Power Poster
Power Poster
Posts: 262
Joined: Thu Jan 11, 2007 9:16 pm
Location: Colorado

Re: Simple News Slider

Post by elkman »

Ok, found the source of the problem. I blocked out the Showtime module and then the scrolling functioned correctly using the "timeout" parameter.

Now I have to learn how to get them both to work on the same page.

Elkman
Locked

Return to “Tips and Tricks”