var first=true;
$(app).on("view_changed",function(e,v){
setTimeout(function(){
var views=app.views.map(function(val){return val.attributes.name});
for (var i=0;i<views.length;i++){
if (views[i]==v) continue;
if (first) {
$(".wp-show_on_"+views[i]).hide();
$(".wp-only_on_"+views[i]).hide();
} else {
$(".wp-only_on_"+views[i]).fadeOut(1500);
}
}
first=false;
$(".wp-show_on_"+v).fadeIn(1500);
$(".wp-only_on_"+v).fadeIn(1500);
},50);
})when you now leave the viewport about the element fades out, and when you go to the viewport about the element fades in