开发者

prototype into jquery migration problem

i try to migrate prototype to jquery. i start with

if (visible) {
        $(name + "_area").setStyle1({ display: 'block' });
    }
    else {
        $(name + "_area").setStyle1({ display: 'none' });   
    }

and i chnage to

function SetAreaVisibility(visible, name) {
if (visible) {
    $(#' + name + '_area').css('display', 'block'); 
}
else {
    $(#' + name + '_area').css('display', 'none'); 
}
开发者_Go百科

which not working like i thing. is this correct code?


what is name+"area" ? if it's an id you'll have to write:

$('#'+name+'_area')

or

$('.'+name+'_area')

for classes. just like css.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜