jquery cycle auto resize


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. drupal_add_js("
  2. jQuery(document).ready(function(){
  3. jQuery('#featured').cycle({
  4. speed: 600,
  5. prev: '#prev',
  6. next: '#next',
  7. fx: 'scrollHorz',
  8. before: onAfter
  9. });
  10. });
  11. function onAfter(curr, next, opts, fwd) {
  12. var ht = jQuery(this).height();
  13. //console.log(ht);
  14. //set the container's height to that of the current slide
  15. jQuery(this).parent().animate({height: ht});
  16. }
  17. ", "inline");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.