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

Started on the old forum in October 2014 · view the original in the archive · old links redirect here

No replies · 58 views · started 12 years ago · 1 min read

GumSlone Administrator Principal · 1,690 posts #1

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:

<div class="video_desc">
    <?php echo $this->video->description;?>
</div>

replace by:

  <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

External image (may be gone)

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close