2017-11-04 6 views
2

나는 Wheelnav js를 사용하고 각 제목을 원 (빨간색 영역)의 안쪽에 정렬하려고합니다. 그러나 나는 실종 됐습니다. mousescrolling을 사용하여 항목을 스크롤 할 수 있어야하지만 그 중 하나는 일어나지 않습니다. (클릭 메뉴에서 스크롤이 작동 중임).Wheelnav js는 동그라미에 제목을 정렬합니다.

감사합니다.

var wheel = new wheelnav("wheelDiv"); 
wheel.wheelRadius = wheel.wheelRadius * 2;//2 
wheel.navItemsContinuous = true; 
wheel.sliceAngle = 8; 
wheel.colors = colorpalette.gamebookers; 
wheel.slicePathFunction = slicePath().NullSlice; 

var anchorAttr = "middle"; 
wheel.titleFont1 = "200 24px Impact, Charcoal, sans-serif"; 
wheel.titleFont2 = "200 34px Impact, Charcoal, sans-serif"; 
wheel.titleAttr = {fill: "#bbb", textAlign: "left", font: wheel.titleFont1,"text-anchor":anchorAttr}; 
wheel.titleHoverAttr = {font: wheel.titleFont1, cursor: 'pointer',"text-anchor":anchorAttr}; 
wheel.titleSelectedAttr = { fill: "#000", textAlign: "left", font: wheel.titleFont2,"text-anchor":anchorAttr}; 

wheel.animatetime = 500; 
wheel.animateeffect = 'linear'; 

wheel.createWheel(["Menu Item -1","Menu - 2","Active Menu Item","Menu - 4","Menu Item - 5","Menu - 6","Active Menu Item","Menu - 8"]); 

enter image description here

답변

1

당신은 initWheel 기능 후 각 navItem의 속성을 수정할 수 있습니다. slicePathCustomization을 통해 제목 위치를 지정할 수 있습니다.

wheel.initWheel(["Menu Item -1", "Menu - 2", "Active Menu Item", "Menu - 4", "Menu Item - 5", "Menu - 6", "Active Menu Item", "Menu - 8"]); 

//Initial 
wheel.sliceInitPathFunction = slicePath().NullSlice; 
wheel.navItems[0].sliceInitPathCustom = new slicePathCustomization(); 
wheel.navItems[0].sliceInitPathCustom.titleRadiusPercent = 0.1; 
//Default 
wheel.slicePathFunction = slicePath().NullSlice; 
wheel.navItems[0].slicePathCustom = new slicePathCustomization(); 
wheel.navItems[0].slicePathCustom.titleRadiusPercent = 0.2; 
//Hover 
wheel.sliceHoverPathFunction = slicePath().NullSlice; 
wheel.navItems[0].sliceHoverPathCustom = new slicePathCustomization(); 
wheel.navItems[0].sliceHoverPathCustom.titleRadiusPercent = 0.3; 
//Selected 
wheel.sliceSelectedPathFunction = slicePath().NullSlice; 
wheel.navItems[0].sliceSelectedPathCustom = new slicePathCustomization(); 
wheel.navItems[0].sliceSelectedPathCustom.titleRadiusPercent = 0.4; 

wheel.createWheel(); 

사용자 정의에 관한 추가 정보 here.

+0

비록 수동이지만, 그럼에도 불구하고 작동하지만 고맙습니다. :) – Deb