Ref: Custom thumbnail or splash screen for embedded youtube video
ALSO, Ref: http://lovesongforever.com ; please notice here what happens to the Youtube generated thumbnail size when the window is resized:
(a) the height does NOT change (b) the width clips BOTH left and right
This is what I want to happen and it does that with Youtube's thumbnail using width: 100% and the fixed height: 420px
However, when I use just a simple image (not the youtube embedded video), (a) happens ... and (b) the width clips just on the right.
How do I do the ORIGINAL a + b using CSS on my image?
The existing code looks like this:
CSS:
.ls_video {
margin-left: auto;
margin-right: auto;
/*
width = 640px crops off just the right edge with window resizing.
width = 100% crops off both edges simultaneously with window resizing.
for the Youtube video, but NOT my image!
*/
width: 100%;
height: 420px;
text-align: left;
}
JS:
var videoSrc = "http://www.youtube.com/embed/MxuIrIZbbu0";
var videoParms = "?autoplay=1&fs=1&hd=1&wmode=transparent";
var youtubeVideo = "" +
"<iframe class='ls_video' src='" + videoSrc + videoParms + "'>" +
"</iframe>";
var theThumbNail = "" +
"<div onclick=\"this.innerHTML = youtubeVideo;\">" +
"<img class='ls_video' src='images/MLSFthumbnail.jpg' style='cursor:pointer' alt='splash' \/> " +
"</div>";
document.write (theThumbNail);