Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
<ul id="list">
<li><a href="?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">1</a></li>
<li><a href="?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">2</a></li>
<li><a href="?phpMyAdmin=4594f30712f4fabaff6997416810f3f2" class="active">3</a></li>
<li><a href="?phpMyAdmin=4594f30712f4fabaff6997416810f3f2">4</a></li>
</ul>var container = $('#list');
var offset = $('li a',container).index($('.active',container));$(document).ready(function() {
var container = $('#list'); //better call the whole thing from inside document.ready
var startPlace = $('li a',container).index($('.active',container));
startPlace = startPlace + 1; // let's add one to startPlace so that we begin with 1 instead of 0
$('#list').jcarousel({
start: startPlace // no need for a semicolon here, as explained later in this thread
});
});Would be happy to.
I'm using a CCK content type ('gallery') which has fields for the name of the photographer, the images themselves (using imagefield), and an additional imagefield for the thumbnail for the gallery.
I'm using Gallerific for my image presentation (it's flexible and I really like that only one image loads initially, and other images are linked to, and then presented via ajax). There's no Drupal module for Gallerific so I fly the script in on the page template.
The first thing I did was set up the node-gallery.tpl.php file so that it works with gallerific. I don't actually ever need a teaser view for each gallery in this site, so in the tpl.php file I simply have:
<div class="content">
<?php if ($node->field_gallery_photocredit[0]['value']) {?>
<p class="photocredit">Images courtesy of <?php print $node->field_gallery_photocredit[0]['value']?></p>
<?php }?>
<?php if ($node->field_showcase_image): ?>
<div id="thumbs-adv" class="navigation">
<h4>Images:</h4>
<ul class="thumbs noscript">
<?php
$i = 1;
foreach($node->field_gallery_image as $img) {
print '<li><a class="thumb" href="/' . $img['filepath'] . '?phpMyAdmin=4594f30712f4fabaff6997416810f3f2" title="' . $i. '">'. $i .'</a></li>' . "\n";
$i++;
}
?>
</ul>
</div>
<div id="gallery-adv" class="gallerycontent">
<div id="controls-adv" class="controls"></div>
<div id="slideshow-adv" class="slideshow"></div>
</div>
<?php endif; ?>
</div>
That set up the Gallerific display. Now I need a menu on the side with thumbnails for each gallery (in a jcaroursel), so I created a View - specifically a block which contains an html list of all galleries. I use fields instead of full node and only use the field of the thumbnail image, linked to the node. I called the View "gallery menu".
Using the Views 2 theming system I create a file in the theme directory called 'views-view-list--gallery-menu.tpl.php' with the following code:
<?php $i=1;?>
<script type="text/javascript">
var container = $('#gallery_menu');
var startingPosition = $('li a',container).index($('.active',container));
jQuery(document).ready(function() {
jQuery('#gallery_menu').jcarousel({
auto: 0,
scroll: 4, //or however many thumbnails you want displayed
vertical: true,
start: startingPosition,
wrap: 'last',
});
$("#gallery_menu a:not(.active)").fadeTo("fast", 0.6);
$("#gallery_menu a:not(.active)").hover(function(){
$(this).fadeTo("fast", 1.0);
},function(){
$(this).fadeTo("fast", 0.6);
});
});
</script>
<ul id="gallery_menu" class="jcarousel-skin-gallery" <?php //print $options['type']; ?>>
<?php foreach ($rows as $id => $row): ?>
<?php $i++; ?>
<li class="<?php print $i;?>"><?php print $row; ?></li>
<?php endforeach; ?>
</<?php print $options['type']; ?>>
as you can see, Kari's suggestions on this thread allow a user to click the thumbnail, see the related gallery; click another thumb and see that gallery - while the thumbnail retains it's proper position in the jcarousel order. Drupal inserts the 'active' class at the correct thumbnail.
1 to 16 of 16