deepson2 Posted May 16, 2009 Share Posted May 16, 2009 hello, can we achieve this using JS slider/mysql/php http://sorgalla.com/projects/jcarousel/examples/static_simple.html I wanted to show one of my selection into this slider instead of paging. can anyone prevoisly work on slider? as soon as i add my php/mysql query into this JS it stops working. can anyone tell, can i achieve this? thanks in advance Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/ Share on other sites More sharing options...
BK87 Posted May 16, 2009 Share Posted May 16, 2009 examples maybe? Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/#findComment-835266 Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 Slider is different than pagination. You'll have to display *ALL* of your images on the page. That can be a lot. You can use it with pagination. It's not exactly hard. Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/#findComment-835292 Share on other sites More sharing options...
deepson2 Posted May 18, 2009 Author Share Posted May 18, 2009 thanks for your reply to both of you Ken2k7,may be its not too hard but i am really finding it hard here is my code. <? if(mysql_num_rows($sqlpage) > 0){ while($row1 = $op->select($sqlpage)){ ?> <div class="NewArrivals"> <div id="New_Arrivalsthum1"> <ul id="mycarousel" class="jcarousel-skin-tango"> <li> <a href='/profile/<?=$blog->spacereplace($row1['username']);?>/' title="<?=$row1['username']?>"><img src="<?=$retpath;?>/<?=$imagearr[0];?>" width="40" height="40" alt="<?=$row1['username']?>"/></a></li> <? }} ?> can you help me? or can you please show mw any sample code where paging is done with slider. Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/#findComment-836186 Share on other sites More sharing options...
deepson2 Posted May 18, 2009 Author Share Posted May 18, 2009 <div class="NewArrivals"> <div id="New_Arrivalsthum1"> <? echo '<ul id="mycarousel" class="jcarousel-skin-tango">'; while($row1 = $op->select($sqlpage)){ $minutes_dif = $row1['MinsSinceLastVisit']; $imagearr = explode(",",$row1['avatar']); $imagearr[0]= preg_replace("/\/avatar\//","/small/", $imagearr[0]); $userName = $row1['username']; $uri = '/profile/'.$blog->spacereplace($userName); $uriImage = $retpath.'/'.$imagearr[0]; echo '<li><a href="',$uri,'" title="',$userName,'"><img src="',$uriImage,'" width="40" height="40" alt="',$userName,'" /></a></li>'; } echo '</ul>'; } ?> </div> </div> now its showing me all the records. but not into slider ??? :-\ here is my JS..do i need to do any changes here? <script> <!-- jQuery library --> <script type="text/javascript" src="lib/jquery-1.2.3.pack.js"></script> <!-- jCarousel library --> <script type="text/javascript" src="../jquery.jcarousel.pack.js"></script> <!-- jCarousel core stylesheet --> <link rel="stylesheet" type="text/css" href="../jquery.jcarousel.css" /> <!-- jCarousel skin stylesheet --> <link rel="stylesheet" type="text/css" href="skins/tango/skin.css" /> <style type="text/css"> /** * Overwrite for having a carousel with dynamic width. */ .jcarousel-skin-tango .jcarousel-container-horizontal { width: 100%; } .jcarousel-skin-tango .jcarousel-clip-horizontal { width: 100%; } </style> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ visible: 4 }); }); </script> Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/#findComment-836219 Share on other sites More sharing options...
deepson2 Posted May 19, 2009 Author Share Posted May 19, 2009 solved my problem. i was just need to place my loop properly. here is my code. if(mysql_num_rows($sqlpage) > 0){ while($row1 = $op->select($sqlpage)){ $imagearr = explode(",",$row1['avatar']); $imagearr[0]= preg_replace("/\/avatar\//","/small/", $imagearr[0]); ?> <li><a href='/profile/<?=$blog->spacereplace($row1['username']);?>/' title="<?=$row1['username']?>"><img src="<?=$retpath;?>/<?=$imagearr[0];?>" width="75" height="75" alt=""/></a></li> <? } }?> </ul> i hope someone may get help with this. Link to comment https://forums.phpfreaks.com/topic/158372-solved-php-pagging-slider/#findComment-836989 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.