chitrank
chitrank

Reputation: 77

use jQuery in meteor?

I have to create a meteor app, but what i did was a simple html/jquery/css page- so now i am facing some issues. i created a filter bar which change as per :

if($(window).width()<=600){
        $('#small-screen-filter').show();       }
    else {          
       $('#big-screen-filter').show();      }

but this is not working so i done :

console.log($(window).width());
if($(window).resize()){
console.log($(window).width()); 

i am getting width of screen only once and the resize function is not working.. PLS help..

Upvotes: 0

Views: 34

Answers (1)

Sean
Sean

Reputation: 2729

You're not using the resize() function correctly.

You need to pass another function which calls console.log() as an argument to resize()

Try

$(window).resize(function() {
    console.log($(window).width()) 
});

Upvotes: 2

Related Questions