1

Hi I am implementing roundabout with 5 images using roundabout.js that is shown here http://fredhq.com/projects/roundabout/demos/standard

So I want to know current front image so that i can implement some trigger whenever user click on it. I don't want to enable trigger when user clicks on the images shown behind the front image.

Trigger is launched only for front images and natural behavior happens for rest of the images at back.

I tried using roundabout_startChildren() function in my Html file but not able to know how to exactly use this function.

tech spartans
  • 370
  • 6
  • 22

1 Answers1

2

NOTE:- i have never used this plugin so please instead of down voting the answer correct me if you think i have misunderstood your problem

here is the DEMO

switch the click off for all movable elements as the page loads and on it when the clicked element hasClass roundabout-in-focus and then animateToNextChild

$('ul').roundabout()
$('ul li').off('click');

$('.roundabout-moveable-item').click(function(e){


if($(this).hasClass('roundabout-in-focus'))
{


    $(this).on('click')
    $('ul').roundabout("animateToNextChild")

}
})

EDIT as per the requirement mentioned in comment

DEMO

$('ul').roundabout()


$('.roundabout-moveable-item').click(function(e){


if($(this).hasClass('roundabout-in-focus'))
{


    window.open('http://www.google.com')
    //use --window.location="http://www.google.com"-- to open in same window

}
})
Udit Bhardwaj
  • 1,761
  • 1
  • 19
  • 29
  • 1
    Hi UDB thanks for reply. As you can see in the url in question , if user click on Block2 or Block5 and Block1 than rotation happens , but i want rotation to happen only for block 2 and block 5 which are currently at back and want to navigate to new url(Page) if user clicks on block1. But in the answer posted by you rotation happens only when i click on front block i.e red colored block. – tech spartans Nov 03 '13 at 15:16
  • @techspartans i have edited the answer and included another demo, have a look. Is that what you want? – Udit Bhardwaj Nov 03 '13 at 15:47
  • @techspartans block in focus will become unclickable after the first click so **EDIT** remove the the line `$(this).off('click')`. http://jsfiddle.net/b754p/4/ – Udit Bhardwaj Nov 03 '13 at 15:58
  • 1
    this is what i want. can you please share complete code. I am not able to integrate this code. I am newbie in JS. So please can you share complete code ? – tech spartans Nov 03 '13 at 16:07
  • 1
    hi i got it working. Thanks a lot. For downloading code refer to http://stackoverflow.com/questions/9851878/is-there-a-download-function-in-jsfiddle – tech spartans Nov 03 '13 at 17:14