3
I wonder if a better way is possible than this, as it would save the repetition of code:
usually do:
if($(window).width() > 800) {
// BLAH BLAH BLAH
}
$(window).resize(function(){
if($(window).width() > 800) {
// BLAH BLAH BLAH
}
});
This does not seem to me a viable/good implementation of code because I am repeating code (BLAH BLAH BLAH), there will be some way to put the two conditions within the same?
But I have other duties within the BLAH BLAH BLAH
– Miguel
@Miguel has no problem, run everything within the new function normally...
– Jader A. Wagner
Obgado, I had thought about it but I thought of 'php', which is not nested functions. Excellent
– Miguel
@Miguel In php you can even run the function itself on it...
– Jader A. Wagner
Yes, but not create/declare functions within other
– Miguel
It does, I just tested it. But obviously the functions declared within another function will only be available after the "mother" function is called at least once... (It is necessary to check re statement)
– Jader A. Wagner
Obgado, you’re right, within a class/object gives also?
– Miguel