예제 #1
0
파일: index.php 프로젝트: ajsky/jeshop
<body>
<div id="wrap">
  <h1>jCarousel</h1>
  <h2>Riding carousels with jQuery</h2>

  <h3>Best Practice Implementation</h3>
  <p>
    This is a recommended unobstrusive example implementation of jCarousel.
  </p>

  <div id="mycarousel" class="jcarousel-container">
    <div class="jcarousel-clip">
      <ul class="jcarousel-list">
        <!-- Add the first visible range of items statically for displaying with javascript disabled -->
<?php 
$jcarousel_items = jcarousel_getItems($jcarousel_visible);
foreach ($jcarousel_items as $item) {
    ?>
        <li><img src="<?php 
    echo htmlspecialchars($item['src']);
    ?>
" width="75" height="75" alt="<?php 
    echo htmlspecialchars($item['title']);
    ?>
" /></li>
<?php 
}
?>
      </ul>
    </div>
  </div>
예제 #2
0
<?php

include_once 'jcarousel_functions.php';
// --
// Array/Database indexes are 0-based, jCarousel positions are 1-based.
$first = intval($_REQUEST['first']) - 1;
$last = max($first + 1, intval($_REQUEST['last']) - 1);
// --
$offset = $first;
$limit = $last - $first + 1;
$items = jcarousel_getItems($limit, $offset);
// ---
header('Content-type: text/xml');
echo '<data>' . "\n";
foreach ($items as $item) {
    echo '  <item>' . "\n";
    foreach ($item as $key => $val) {
        echo '    <' . $key . '>' . htmlspecialchars($val) . '</' . $key . '>' . "\n";
    }
    echo '  </item>' . "\n";
}
echo '</data>';