Return to Snippet

Revision: 61754
at January 12, 2013 06:57 by vijayrajesh

Initial Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" lang="en-US">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Demo Page For Autoplay youtube video while clicking on a custom thumbnail image</title>
<link href=',300,600,700' rel='stylesheet' type='text/css'><script  type="text/javascript" src=""></script>
		margin	: 0;
		padding	: 0;
		background	: #EEE;
		color		: #333;
		font-family: 'Open Sans', sans-serif;
		font-size	: 12px;
		width	: 1012px;
		margin	: 0 auto;
	<div id="wrapper">
		<h1>Demo Page For Autoplay youtube video while clicking on a custom thumbnail image</h1>
		<div class="custom-th"><img src="" style="cursor:pointer" /></div>
		<div id="thevideo" style="display:none">
		<object width="560" height="315"><param name="movie" value=";version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src=";version=3&autoplay=1" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
		<p>Demo by : <a href="">WordPress Themes</a> </br>
		Article Link : <a href="">Custom Thumbnail with fadeout animation for Youtube Videos</a>
	<script type="text/javascript">
	$(document).ready(function() {
		$('.custom-th').click(function() {
			$('.custom-th').fadeOut('slow', function() {

Initial URL

Initial Description
The thumbnails of Youtube videos are generally low in quality.  Sometimes, the thumbnail is not enough to get the people attention.  Here is a small code I have written that works as follows.

A custom thumbnail is displayed at the size of 560px width and 615px height.  When the user clicks on it, the image fade outs.  Yes it will get animated as fade out.  We use jQuery fadeout function for it.  After that the video gets displayed.

Initial Title
Autoplay youtube video while clicking on a custom thumbnail image

Initial Tags

Initial Language