Jump to content

[SOLVED] php pagging- Slider


deepson2

Recommended Posts

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

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.

<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>

solved my problem.  ;D

 

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. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.