Adding a Jcarousel effect to a <ul> of a block view.
Install jquery_update module.
Download Jcarousel. Unzip to theme folder.
Create a block view, than publish it.
Add this snippet inside the <head> part of page.tpl.php:
<script type="text/javascript" src="<?php print base_path() . path_to_theme() ?>/jcarousel/lib/jquery.jcarousel.pack.js"></script>
<link rel="stylesheet" type="text/css" href="<?php print base_path() . path_to_theme() ?>/jcarousel/lib/jquery.jcarousel.css" />
<link rel="stylesheet" type="text/css" href="<?php print base_path() . path_to_theme() ?>/jcarousel/skins/tango/skin.css" />
<script type="text/javascript">
jQuery(document).ready(function() {
$("div.view-class-name").find("ul").attr("id","jcarousel");
$("#jcarousel").addClass("jcarousel-skin-tango");
$("#jcarousel").jcarousel({
vertical: true,
scroll: 1
});
});
</script>Via drupal.org forums. Posted here for reference.
Comments
Post new comment