I want to implement simple pagination using jQuery. I get the data from a jQuery ajax call, I tried for the same but it is not working. Here is my working code & let me know what i missed in this.  

[Check this fiddle](http://jsfiddle.net/jcq8h7b2/113/)

Here is code for paging 

```
pageSize = 8;
            var pageCount = $(".portlet").length / pageSize;
            for (var i = 0; i < pageCount; i++) {
                $("#pagin").append('<li><a href="#">' + (i + 1) + '</a></li> ');
            }
            $("#pagin li").first().find("a").addClass("current")
            showPage = function (page) {
                $(".line-content").hide();
                $(".line-content").each(function (n) {
                    if (n >= pageSize * (page - 1) && n < pageSize * page)
                        $(this).show();
                });
            }
            showPage(1);
            $("#pagin li a").click(function () {
                $("#pagin li a").removeClass("current");
                $(this).addClass("current");
                showPage(parseInt($(this).text()))
            });

```