In my MVC project I want to refresh my page with new entries using AJAX.Everything is working great but I want to add some effect when displaying the new entries. First I use prepend like this:
$(".mCSB_container").prepend(data.htmlContent);
Then is I do this:
$(".entry:lt(4)").hide().fadeIn(3000);
It is working correctly.But, I would like to do it with a dynamic variable.I'm returning the new entry count from my Controller Action and set it like this:
var count = data.count;
And when I want to use it like:
$(".entry:lt(count)").hide().fadeIn(3000);
Visual studio show me the error message that says: Expected <integer>
.I tried this when I defining the count:
var count = new Number(data.count);
But that doesn't make any difference.Basically I want to select first N
items with a given class, then hide and display them with fadeIn. How can I do it if the element count is dynamic ? Is it possible with :lt
selector or is there another way I can use ?