Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $Id$
- /**
- * @file
- * Main Module
- */
- /**
- * Implementation of hook_views_api().
- */
- function views_horizontal_slider_views_api() {
- return array(
- 'api' => 2.0,
- );
- }
- /* add the actual inline lightweight jquery script */
- function views_horizontal_slider_add_js($options) {
- $script = "
- $(document).ready(function(){
- lastBlock = $('.views_horizontal_slider ul li.hitem-2');
- maxWidth = " . check_plain($options['max_width']) . ";
- minWidth = " . check_plain($options['min_width']) . ";
- $('.views_horizontal_slider ul li').hover(
- function(){
- $(lastBlock).animate({width: minWidth+'px'}, { queue:false, duration:" . check_plain($options['animate_in']) . " });
- $(this).animate({width: maxWidth+'px'}, { queue:false, duration:" . check_plain($options['animate_out']) . "});
- lastBlock = this;
- }
- );
- });
- ";
- drupal_add_js($script, 'inline');
- }
Add Comment
Please, Sign In to add comment