Guest User

Untitled

a guest
Jan 18th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php
  2. // $Id$
  3.  
  4. /**
  5. * @file
  6. * Main Module
  7. */
  8.  
  9. /**
  10. * Implementation of hook_views_api().
  11. */
  12. function views_horizontal_slider_views_api() {
  13. return array(
  14. 'api' => 2.0,
  15. );
  16. }
  17.  
  18. /* add the actual inline lightweight jquery script */
  19.  
  20. function views_horizontal_slider_add_js($options) {
  21. $script = "
  22. $(document).ready(function(){
  23. lastBlock = $('.views_horizontal_slider ul li.hitem-2');
  24. maxWidth = " . check_plain($options['max_width']) . ";
  25. minWidth = " . check_plain($options['min_width']) . ";
  26.  
  27. $('.views_horizontal_slider ul li').hover(
  28. function(){
  29. $(lastBlock).animate({width: minWidth+'px'}, { queue:false, duration:" . check_plain($options['animate_in']) . " });
  30. $(this).animate({width: maxWidth+'px'}, { queue:false, duration:" . check_plain($options['animate_out']) . "});
  31. lastBlock = this;
  32. }
  33. );
  34. });
  35. ";
  36. drupal_add_js($script, 'inline');
  37. }
Add Comment
Please, Sign In to add comment