show less or more for long video description for video view page SE4 Video Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to show less or more for long video description for video view page SE4 Video Plugin

    This hack adds a less/more link for long video descriptions on the video view page:

    open:
    /application/modules/Video/views/scripts/index/view.tpl

    find:
    HTML Code:
    <div class="video_desc">
        <?php echo $this->video->description;?>
    </div>
    replace by:

    HTML Code:
      <div class="video_desc" id="video_desc_show_more" style="overflow:hidden; max-height:50px;">
        <?php echo $this->video->description;?>
      </div>
      <a href="javascript:;" id ="show_more_link" onclick="showMore()"><?php echo $this->translate('more');?></a>
      <a href="javascript:;" id ="show_less_link" style="display:none;" onclick="showLess()"><?php echo $this->translate('less');?></a>
    <script type="text/javascript">
    var desc_scrol_height = $('video_desc_show_more').getScrollHeight()
    if(desc_scrol_height<=50)
    {
        $('show_more_link').toggle();
    }
     
    function showMore() {
        new Fx.Tween($('video_desc_show_more'), {
            duration: 1000
        }).start('max-height', $('video_desc_show_more').getScrollHeight());
        $('show_less_link').toggle();
        $('show_more_link').toggle();
    }
     
    function showLess() {
        new Fx.Tween($('video_desc_show_more'), {
            duration: 1000
        }).start('max-height', 50);
        $('show_less_link').toggle();
        $('show_more_link').toggle();
    }
    </script>
    Done!
    Advertise your mobile site for FREE with AdTwirl

Working...
X