Manual rotation via external pager elements?

tom-a-spol-sro - May 4, 2009 - 08:23
Project:Rotor Banner
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hello, I'd like to ask a little question...

Am I somehow able to add 2 arrows (just outside the Rotator block), that would make the rotator to switch to 'next' or 'previous' item?

Arrows are images inside the tag.

Thanks a lot for replies,
Tomas.

#1

tom-a-spol-sro - May 4, 2009 - 08:26

ummm, sorry I didn't expect that the form will parse the "a" tag into link :)

#2

mrfelton - May 4, 2009 - 10:42
Status:active» won't fix

This is really outside the scope or rotor.module. If you want to do this, you will need to write some JavaScript of your own. Rotor is powered by jQuery.cycle... The examples on this page should show you what you need to do: http://malsup.com/jquery/cycle/int2.html

#3

tom-a-spol-sro - May 5, 2009 - 08:01
Status:won't fix» closed

okay, I solved it myself, thanks to the link mrfelton provided.

For those who would want to do the same, it's really easy.
In the page, you have two arrows:

<a href="#" id="example_prev">PREVIOUS</a>
<a href="#" id="example_next">NEXT</a>

and when you open the rotor.js file, you change the code from:

$('div.rotor-items', $rotor).cycle({
  timeout: settings.time * 1000,
  speed: settings.speed,
  fx: settings.effect,
  pause: settings.pause,
  pager: $('div.rotor-tabs', $rotor),
  pagerAnchorBuilder: function(idx, slide){
  return $('div.rotor-tabs .rotor-tab:eq(' + idx + ')', $rotor);
  }
});

to:

$('div.rotor-items', $rotor).cycle({
  timeout: settings.time * 1000,
  speed: settings.speed,
  fx: settings.effect,
  next: '#example_next',
  prev: '#example_prev',
  pause: settings.pause,
  pager: $('div.rotor-tabs', $rotor),
  pagerAnchorBuilder: function(idx, slide){
  return $('div.rotor-tabs .rotor-tab:eq(' + idx + ')', $rotor);
  }
});

#4

mrfelton - May 5, 2009 - 08:15
Title:Manual rotation via arrows outside the block?» Manual rotation via external pager elements?
Version:6.x-2.1» 6.x-2.x-dev
Category:support request» feature request
Priority:minor» normal
Status:closed» active

I'm upgrading this ticket into a feature request. I think it would be fairly simple to provide a means of specifying the css selector used to select DOM elements to be used as previous/next buttons.

 
 

Drupal is a registered trademark of Dries Buytaert.