deepson2 Posted May 18, 2009 Share Posted May 18, 2009 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. Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted May 18, 2009 Share Posted May 18, 2009 What are the errors you recieve? And what does the html output look like? Quote Link to comment Share on other sites More sharing options...
deepson2 Posted May 18, 2009 Author Share Posted May 18, 2009 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. Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted May 18, 2009 Share Posted May 18, 2009 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? Quote Link to comment Share on other sites More sharing options...
deepson2 Posted May 18, 2009 Author Share Posted May 18, 2009 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 Quote Link to comment Share on other sites More sharing options...
deepson2 Posted May 18, 2009 Author Share Posted May 18, 2009 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 ? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted May 19, 2009 Share Posted May 19, 2009 you can enable it under tab named "Net" then you should see the error's displayed under the tab "Console" Quote Link to comment Share on other sites More sharing options...
deepson2 Posted May 19, 2009 Author Share Posted May 19, 2009 thanks for your reply Dj Kat. i have solved my problem.. 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.