Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82c4064
commit 1864388
Showing
2 changed files
with
160 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,147 @@ | |||
jQuery(document).ready(function() | |||
{ | |||
|
|||
var currentImage = ""; | |||
var interfaceLock = false; | |||
|
|||
jQuery("#roundrr_container").roundrrwheel( | |||
{ | |||
|
|||
centerClass: 'roundrr_center', | |||
listClass: 'list', | |||
itemClass: 'item', | |||
radius: 220, | |||
animSpeed:400, | |||
centerX: 29, | |||
centerY: 60, | |||
animationEffect: 1, //(1:off, 5:light,10:heavy, 15:subtle) | |||
selectEvent: "click", | |||
//on selecting/clicking an item on the wheel | |||
onSelect: function($selected) | |||
{ | |||
showLargeImage($selected, 'noanim'); | |||
}, | |||
//on beginning to spin/animate the wheel | |||
onNextBegin: function($m) | |||
{ | |||
|
|||
interfaceLock = true; | |||
|
|||
}, | |||
onPrevBegin: function($m) | |||
{ | |||
|
|||
interfaceLock = true; | |||
|
|||
}, | |||
//once an image has moved under the 'pick' | |||
onImageFocus: function($item) | |||
{ | |||
|
|||
showLargeImage($item, 'none'); | |||
|
|||
|
|||
}, | |||
//once an image/image set is no longer under the 'pick' | |||
onImageBlur: function($item) | |||
{ | |||
|
|||
}, | |||
//once the animation has completed | |||
onAnimationComplete: function($menu) | |||
{ | |||
|
|||
jQuery('.centerImage').attr('src', currentImage); | |||
jQuery('.centerImage').load(function() | |||
{ | |||
|
|||
interfaceLock = false; | |||
}); | |||
|
|||
|
|||
}, | |||
angleOffset: Math.PI, | |||
onShow: function($menuitems) | |||
{ | |||
$menuitems.each(function(i) | |||
{ | |||
var $this = jQuery(this); | |||
$this.delay(i*100).fadeIn(500); | |||
}); | |||
|
|||
|
|||
} | |||
|
|||
}); | |||
|
|||
jQuery("#roundrr_container").roundrrwheel("show"); | |||
$('#next').bind('click', spinMenuLeft); | |||
$('#prev').bind('click', spinMenuRight); | |||
|
|||
function showLargeImage($i, mode) | |||
{ | |||
|
|||
interfaceLock = true; | |||
var thisImage = $i.find('img'); | |||
var focusedImage = thisImage.attr('src'); | |||
var largerImage = focusedImage.replace('_bigger', ''); | |||
var imageCaption = thisImage.attr('alt'); | |||
var speechBubble = jQuery('.roundrr_speech'); | |||
speechBubble.fadeIn(); | |||
|
|||
currentImage = largerImage; | |||
|
|||
jQuery('#roundrr_caption').fadeIn(); | |||
jQuery('#roundrr_caption').html(imageCaption); | |||
|
|||
if(mode=='noanim') | |||
{ | |||
|
|||
jQuery('.centerImage').attr('src', currentImage); | |||
jQuery('.centerImage').load(function() | |||
{ | |||
interfaceLock = false; | |||
|
|||
}); | |||
} | |||
|
|||
} | |||
|
|||
|
|||
/*Spin the menu to the left*/ | |||
function spinMenuLeft() | |||
{ | |||
if(!(interfaceLock)) | |||
{ | |||
jQuery("#roundrr_container").roundrrwheel("prev"); | |||
} | |||
} | |||
|
|||
/*Spin the menu to the right*/ | |||
function spinMenuRight() | |||
{ | |||
if(!(interfaceLock)) | |||
{ | |||
jQuery("#roundrr_container").roundrrwheel("next"); | |||
} | |||
} | |||
|
|||
/*Keydown events*/ | |||
$(window).keydown(function(event) | |||
{ | |||
var keycode = event.keyCode; | |||
switch(keycode) | |||
{ | |||
case 39: | |||
spinMenuLeft(); | |||
break; | |||
case 37: | |||
spinMenuRight(); | |||
break; | |||
} }); | |||
|
|||
|
|||
|
|||
//setInterval(spinMenuLeft, 5000); | |||
|
|||
}); |