Jump to content

[SOLVED] jCarousel slider


deepson2

Recommended Posts

Hello,

 

I want to show one of my selected result ito jCarousel slider. with this code, now its showing me o/p. it means my php is working. and java script is not. so can anyone help me here about how can i show my result into slider?

PHP Code:

 

 

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

 

JS code

JavaScript Code:

 

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

 

thanks in advance.

Link to comment
Share on other sites

What are the errors you recieve?

 

thanks for your reply Dj Kat. i am not getting any error. till this morning values were not coming into my while loop. but now i am getting values. but they are not coming into my slider format like this

 

http://sorgalla.com/projects/jcarousel/examples/static_simple.html

 

And what does the html output look like?

my selection query is giving me 5 avatar of recent visitors who are visited to that particular userid

 

do you know how can get my selection query into this kinda of format?

please help me.

Link to comment
Share on other sites

What does the following look like when you check your browser source

<?php
    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>';
?>

It looks like it it suppose to give the correct output. Do you have any js debugger tool such as firebug?

Link to comment
Share on other sites

Dj Kat, i don't have firebug

 

could you please take any simple table from your database and just check with Jcarousel slider that whether its working or not. because i have searched a lot on the web about this data fetching with slider. but didnt get anything.

 

so could you please check and tell me, that can we actually  ??? >:( fetch records with jCarousel Slider. or any kinda of slider?

 

please help me  :(

Link to comment
Share on other sites

yes i do have firbug. but when click on script with enable its showing me whole code.and on the right side its not showing anything. it works for css is that my co-worker told me. how can i enable java script debugger please tell me ?

Link to comment
Share on other sites

thanks for your reply Dj Kat. i have solved my problem.. ;D

it was not java script issue. actually i was just need to place my loop properly. and i have spent 2 days on it. here is my code

 

if(mysql_num_rows($sqlpage) > 0){
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];

?>
<li><a href='/profile/<?=$blog->spacereplace($row1['username']);?>/' title="<?=$row1['username']?>"><img src="<?=$retpath;?>/<?=$imagearr[0];?>" width="75" height="75" alt=""/></a></li>
<? } }?>

</ul>

 

may someone get help with this.if they are looking for it.  :)

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.