I have a grid like this:
<div class="main">
<ul id="og-grid" class="og-grid">
<li>
<a href="http://..." data-video="my-url" data-largesrc="images/1.jpg" data-title="Title" data-description="Description">
<img src="images/thumbs/1.jpg" alt="img01"/>
</a>
</li>
</ul>
</div>
The data-video parameter is a url, in JavaScript I don't know how to create this function appropriately:
Preview.prototype = {
create : function() {
this.$title = $( '<h3></h3>' );
this.$description = $( '<p></p>' );
this.$href = $( '<a href="#">Visit website</a>' );
this.$details = $( '<div class="og-details"></div>' ).append( this.$title, this.$description, this.$href );
this.$loading = $( '<div class="og-loading"></div>' );
this.$fullimage = $( '<div class="og-fullimg"></div>' ).append( this.$loading );
this.$videosrc = $( '<iframe class="og-video" width="560" height="315" src="data-video" frameborder="0" allowfullscreen></iframe>' ).append( this.$loading );
this.$closePreview = $( '<span class="og-close"></span>' );
this.$previewInner = $( '<div class="og-expander-inner"></div>' ).append( this.$closePreview, this.$videosrc, this.$details );
this.$previewEl = $( '<div class="og-expander"></div>' ).append( this.$previewInner );
this.$item.append( this.getEl() );
if( support ) {
this.setTransition();
}
}
How could I call the data-video url of my html file inside the this.$videosrc of this JavaScript where src is declared?