开发者

prototype into jquery migration problem

开发者 https://www.devze.com 2023-02-04 00:17 出处:网络
i try to migrate prototype to jquery. i start with if (visible) { $(name + \"_area\").setStyle1({ display: \'block\' });

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

精彩评论

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