Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Can.Components show hide

$
0
0
http://canjs.com/docs/can.route.html

3 common ways I do it





can.Control({

"{can.route} change": function(ev, attr, how, newVal, oldVal) {
if (attr === "type") {
this.element.find('div.show-hide').toggle()
}
}
})

or

"{can.route} type change":function(){

this.element.find('div.show-hide').toggle()

}

or in init or some other function:

can.route.bind('change', function(ev, attr, how, newVal, oldVal){

this.element.find('div.show-hide').toggle()

})

Viewing all articles
Browse latest Browse all 3491

Trending Articles