ループを介してデータ値を割り当てていますが、それぞれの要素を確認しているときに、属性が見つかりません...関数を修正する人はいますか?
var paper = new Raphael('slideContainer', 930, 420);
//mainpage circles;-
var mainPageCircle = {
circles :{
cR:{color:'#730000',text:'Content'},
cB:{color:'#004f74',text:'Consulting'},
cG:{color:'#146c00',text:'Commerce'}
},
radious:100,
stroke:10,
strokeColor:'#fff',
opacity:0.7
}
$.each(mainCrProp.circles, function (n) {
pCircles = paper.circle(
n==='cR' ? (paperWidth/2) - mainCrProp.radious/2 :
n==='cB' ? paper.getById('cR').attr('cx') + mainCrProp.radious : (paperWidth/2),
n==='cR' ? (paperHeight/2) - mainCrProp.radious/2 :
n==='cB' ? paper.getById('cR').attr('cy') :
n==='cG' ? paper.getById('cR').attr('cy') + mainCrProp.radious : paperHeight/2,
mainCrProp.radious)
.attr({fill:this.color,'stroke-width':mainCrProp.stroke,stroke:mainCrProp.strokeColor,opacity:mainCrProp.opacity})
.data('dClass',(i+'Group'))//i am setting my data..
.id = n;
//
pText = paper.text( n==='cR' ? (paperWidth/2) - mainCrProp.radious:
n==='cB' ? paper.getById('cR').attr('cx') + mainCrProp.radious*1.5 : (paperWidth/2),
n==='cR' ? (paperHeight/2) - mainCrProp.radious/2 :
n==='cB' ? paper.getById('cR').attr('cy') :
n==='cG' ? paper.getById('cR').attr('cy') + mainCrProp.radious*1.5 : paperHeight/2,
this.text)
.data('dClass',(i+'Group'))//i am setting my data
.id = n+'text';
pGroup[i] = paper.set(pCircles,pText);
i++;
} )
paper.forEach(function (el) {
console.log(el.data('dClass'));// i am not getting any data value..
} )