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

Link to comment
Share on other sites

<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
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.