Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeigniter scrollpagination
    primarykey
    data
    text
    <p>I am using jquery plugin <strong>scrollpagination</strong> in codeigniter i am facing problem that my loop does not terminate and alos not giving accurate result.</p> <p>this is my <strong>html</strong> code</p> <pre><code>&lt;div id="main"&gt; &lt;div id='friend_display'&gt; &lt;?php if($list-&gt;num_rows() &gt; 0 ){ foreach($list-&gt;result() as $show) { ?&gt; &lt;div class="image-box" style="margin-left:30px" id='image-holder' &gt; &lt;div class="photo-cover"&gt; &lt;a href="&lt;?=base_url()?&gt;uploads/user_images/&lt;?php echo $show-&gt;user_image;?&gt;" class="big-image"&gt;&lt;img width="160px" height="117px" src="&lt;?=base_url()?&gt;uploads/user_images/friends/&lt;?php echo $show-&gt;user_image;?&gt;" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;p class="photo-name"&gt;&lt;b&gt;&lt;?php echo $show-&gt;user_name;?&gt;&lt;/b&gt;&lt;/p&gt; &lt;/div&gt; &lt;?php } } else { echo '&lt;div align="center" style="color:#FF0000; font-size:17px; font-weight:bold"&gt;You have no Friends yet&lt;/div&gt;';}?&gt; &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt; </code></pre> <p>this is <strong>script</strong></p> <pre><code> &lt;script type="text/javascript"&gt; var page_num = 1; $(function(){ $('#friend_display').scrollPagination({ 'contentPage': '&lt;?=base_url()?&gt;friends/load_more', // the url you are fetching the results 'contentData': {page_num:$('.image-box').size()}, // these are the variables you can pass to the request, for example: children().size() to know which page you are 'scrollTarget': $(window), // who gonna scroll? in this example, the full window 'heightOffset': 10, // it gonna request when scroll is 10 pixels before the page ends 'beforeLoad': function(){ // before load function, you can display a preloader div $('#loading1').fadeIn(); }, 'afterLoad': function(elementsLoaded){ // after loading content, you can use this function to animate your new elements $('#loading1').fadeOut(); var i = 0; $(elementsLoaded).fadeInWithDelay(); page_num:$('.image-box').size(); } }); // code for fade in element by element $.fn.fadeInWithDelay = function(){ var delay = 0; return this.each(function(){ $(this).delay(delay).animate({opacity:1}, 200); delay += 100; }); }; }); &lt;/script&gt; </code></pre> <p>and this is my <strong>php</strong> function</p> <pre><code> function load_more() { $offset = $this-&gt;input-&gt;post('page_num'); $list = $this-&gt;friends_model-&gt;show_friends($offset); if($list-&gt;num_rows()&gt;0) { foreach($list-&gt;result() as $show) {?&gt; &lt;div class="image-box" style="margin-left:30px" id='image-holder'&gt; &lt;div class="photo-cover"&gt; &lt;a href="&lt;?=base_url()?&gt;uploads/user_images/&lt;?php echo $show-&gt;user_image;?&gt;" class="big-image"&gt;&lt;img width="160px" height="117px" src="&lt;?=base_url()?&gt;uploads/user_images/friends/&lt;?php echo $show-&gt;user_image;?&gt;" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;p class="photo-name"&gt;&lt;b&gt;&lt;?php echo $show-&gt;user_name;?&gt;&lt;/b&gt;&lt;/p&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;div class="cl"&gt;&amp;nbsp;&lt;/div&gt; &lt;?php } else { //echo(333); } } </code></pre> <p>in <strong>db</strong> i jst shoing main query $this->db->limit(12,$offset); can someone tell me what i am missing?</p> <p>Open this Link to wathch complete code.<a href="http://pastebin.com/MC1KZm8y" rel="nofollow">Scroll Pagination</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload