Jump to content
  • 0

нужна помощь с Rapha?l


undermuz
 Share

Question


...
var l_s;
...

function init_m(....){
...
r_right = getAttributes(s_tag)["r.right"]; //Ширина
r_bottom = getAttributes(s_tag)["r.bottom"]; //Высота

$("#cont").css('width', r_right*cscale+'px'); //Задание размеров
$("#cont").css('height', r_bottom*cscale+'px'); //..

l_s = Raphael(document.getElementById("cont"), r_right, r_bottom);
...
}
function print_scheme(){//Отрисовка
..
for(line_s in line_arry){
x1 = line_arry[line_s].x1;
x2 = line_arry[line_s].x2;
y1 = line_arry[line_s].y1;
y2 = line_arry[line_s].y2;

if((x1 != '' && x2 != '' && y1 != '' && y2 != '') && (x1 != null && x2 != null && y1 != null && y2 != null) && (x1 != 'NaN' && x2 != 'NaN' && y1 != 'NaN' && y2 != 'NaN'))
line_arry[line_s] = l_s.path('M'+x1*cscale+' '+y1*cscale+'L'+x2*cscale+' '+y2*cscale).attr('fill','#999');
}
..
}

Ошибок нет, но почему-то не отрисовывает линии.

но если сделать так:


...

function print_scheme(){//Отрисовка
..
var l_s = Raphael(document.getElementById("cont"), r_right, r_bottom);
for(line_s in line_arry){
x1 = line_arry[line_s].x1;
x2 = line_arry[line_s].x2;
y1 = line_arry[line_s].y1;
y2 = line_arry[line_s].y2;

if((x1 != '' && x2 != '' && y1 != '' && y2 != '') && (x1 != null && x2 != null && y1 != null && y2 != null) && (x1 != 'NaN' && x2 != 'NaN' && y1 != 'NaN' && y2 != 'NaN'))
line_arry[line_s] = l_s.path('M'+x1*cscale+' '+y1*cscale+'L'+x2*cscale+' '+y2*cscale).attr('fill','#999');
}
..
}

то все ресует, вот только доступа к элементам у меня потом нет...в чем проблема, подскажите..очень большой проэкт. нужно срочно...зарание спасибо

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy