Vertical Slide with Jquery

Discussion in 'jQuery' started by Romik84, Apr 17, 2010.

  1. #1
    Hello,

    I am currently trying to modify this script: http://www.chazzuka.com/blog/?p=95 .

    For now, I have this code:

    JS
    <script>
    $(function(){
    	/**
    	*	Jquery Horizontal Slide Navigation
    	*	webmaster@chazzuka.com
    	*	http://www.chazzuka.com
    	*	Nov 13th 2008 @ Denpasar, Bali Paradise Island
    	**/
    	//@ active scroll
        var _active = null;
    	//@ max expand in pixel
        var _hmax = 80;
    	//@ min height in pixel
        var _hmin = 0;
    	//@ loop through matches selector
        $("#recent-in-network ul li").each(function(){
    		//@ in/out handler
    		$(this).hover(
    			//@ hover
    			function(){
    				//@ child span expand
    				$(this).find('.post-ex').animate({height: _hmax+"px"}, {queue:false, duration:300, easing:'easeOutBack'});
    				//@ set active to current hovered
    				_active = $(this);
    			},
    			//@ out
    			function() {
    				//@ slide back
    				$(_active).find('.post-ex').animate({height: _hmin+"px"}, {queue:false, duration:300,easing:'easeInBack'});
    			}
    		);
    	});
    });
    </script>
    Code (markup):
    CSS
    #recent-in-network ul {position:relative;display:inline;float:left;margin:10px 0 30px 0;}  
    #recent-in-network ul li {display:inline-block;height:45px;background:#f1f1f1;width:440px;padding:5px;margin:5px 0;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}
    #recent-in-network ul li .text {display:block;}
    #recent-in-network a.title {font:normal 15px/20px segoe ui;padding:5px 3px;text-decoration:none;color:#0080ff;}
    #recent-in-network a.title:hover {text-decoration:none;color:#005ebb;}
    #recent-in-network .post-ex {display:inline-block; height:0px; overflow:hidden;font-size:11px;margin:10px 5px;}
    Code (markup):

    HTML

    
    
    <div id="recent-in-network">
    
    <ul>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <li>
    
    <span class="text">
     
    <a class="title" href="<?php the_permalink() ?>" target="_blank">
    <?php
    $title = the_title('', '', false);
    echo truncate($title, 42, '...');
     ?></a> <br />
     
    </span>
    
    <br />
    
    
    <span class="post-ex"><?php echo strip_string(150,get_the_excerpt()); ?></span>
    
    </li>   <?php endwhile; endif; ?>
    
    
    </ul></div> 
    Code (markup):
    I try to expand the text in the "post-ex" tag after I hover the "li" but have no luck. What am I doing wrong?
     
    Romik84, Apr 17, 2010 IP