selecting iframes of youtube videos - html

I have a page which displays images of youtube videos, and the user can select videos out of them.
I am displaying them like this
<ul>
<li>
<div class="youtubeMediaContainer">
<img src="video_preview_image1.jpg">
<img src="play_icon.png">
</div>
</li>
<li>
<div class="youtubeMediaContainer">
<img src="video_preview_image2.jpg">
<img src="play_icon.png">
</div>
</li>
<ul>
The user can select these videos (by selecting i mean a big border appearing on the container indicating that its selected) from here by clicking on the container (the image, except for the area occupied by the play icon). But the users can also play these videos by clicking on the play icons. When the click, the contents of youtubeMediaContainer is replaced by the youtube iframe where videos play.
Now the issue is that after a video is played, how does the user now select that video. Can i put an overlay of sorts over the iframe? What would be the best way for this?

Why not perhaps create a separate player div inside the entry? In the manner of:
<ul>
<li>
<div class="youtubeListEntry">
<img src="video_preview_image1.jpg">
<img src="play_icon.png">
<div id="youtubeMediaPlaceholder1"></div>
</div>
</li>
<li>
<div class="youtubeListEntry">
<img src="video_preview_image2.jpg">
<img src="play_icon.png">
<div id="youtubeMediaPlaceholder2"></div>
</div>
</li>
<ul>
This way, you still retain your original structure so you can have the user select the video.

Related

Problem with naming and display name of picture in frame, <a> in HTML

I try to create my portfolio with using GitHub Pages https://rageanalyst.github.io/Portfolio/. I use a template and alter him. I don't know HTML. I have a problem with caption when I open a frame with project. Two pictures don't underneath, they have (untitled). Only the last picture have caption and is the project tittle.
Problem: example
Q: How can I add caption to individual pictures in this frame?
This is extract of code when I have a single project:
<article class="col-6 col-12-xsmall work-item">
<a href="images/thumbs/trainings.JPG" class="image fit thumb"><img src="images/fulls/gym.jpg" alt="" />
</a>
<h3>Gym Tracker</h3>
<p>This project contains tables that allow me to track my progress in the gym. </p><br>
<ul class="actions">
<li>Full Project</li>
</ul>
</article>
Edit:
I still haven't solved the problem, anyone else can help me?

Anchor tags working inconsistently in my web page

Here's an actual video recording of what the problem is (I'm not trying to advertise in any way): https://www.youtube.com/watch?v=7b38cQ0VGWI
So I'm creating a website just for practice's sake, and everything was going smoothly until I ran into this problem. I have 2 <nav> menus, where the top main nav bar leads one to another page, while the 2nd nav bar leads one to a certain section within the same page. But I'm having problems with the 2nd nav bar. So below is the html I'm using:
<nav class="navbar">
<div class="container">
<ul>
<li>Drama</li>
<li>Comedy</li>
<li>Romance</li>
<li>Action</li>
</ul>
</div>
</nav>
After this is a series of movie picture lists but I'm only going input 2 below as an example:
<div class="grid-picture">
<!--First row of movies-->
<div id="action">
<div class="movies">
<a href="https://www.imdb.com/title/tt2911666/" target="_blank">
<img src="https://images-na.ssl-images-amazon.com/images/I/91atCmxi6hL._UR1200,1600_RI_.jpg">
<h3>John Wick</h3>
<p>Action, Crime, Triller</p>
</a>
</div>
</div>
<br>
<!--1st row of romance movies-->
<div id="romance">
<div class="movies">
<a href="https://www.imdb.com/title/tt1638002/?ref_=nv_sr_srsg_0">
<img src="https://kbimages1-a.akamaihd.net/beb95aaa-36b7-444d-8557-0cb7efa8e898/1200/1200/False/love-rosie-1.jpg">
<h3>Love, Rosie</h3>
<p>Comedy, Romance</p>
</a>
</div>
</div>
</div>
As you can see, "John Wick" is within a div tag with an ID of "action", while "Love, Rosie" is within a div tag with an ID of "romance." Now, the "Action" link works fine; it directs the page exactly where the movies within the ID of "action" are. However, when I click the "Romance" link, it doesn't take me to the bottom of the website. Rather, it takes me to the same place as if I clicked the "Action" link.
So basically, the anchor tag isn't working for me even though I made sure to input href="#romance" and also made sure to wrap around the movie "Love, Rosie" within a div tag with an ID of "romance". External links work just fine, only that internal links aren't working as I assumed it would. I also quadruple checked if I had any unclosed div tags, but that wasn't the case.
PS: all of the movies are in the same page.

Linking an image breaks slider

I'm using a hybrid HTML/CSS/Java coding sheet that I copied and modified for my own use. So far, the customization has gone well except for trying to link images. The weird thing about it is, it only messes up when I link the first image.
When I link the first image, none of them will show up. If I link only the second and third, all of the images show up and the last two slides even link. I have looked through many times and I still can't understand why it won't work. There isn't anything in the Javascript (that I can see) that doesn't allow links and being that they're simple <li> it seems like it should work normally. Any ideas?
This is the part I'm having issues with:
<div class="container">
<div class="slider_wrapper">
<ul id="image_slider">
<li><img src="/assets/SLC_SewingMachineThread_banner.jpg"></li>
<li><a href="Teddy-Bear-Pattern-Pack">
<img src="assets/SLC_TeddyBear_Pattern_Banner.jpg"></a>
</li>
<li><a href="Leather/Pre-Cut-Leather-Pieces/Oil-Tan-Pre-Cuts">
<img src="assets/SLC_OilTan_PreCut_banner.jpg"></a>
</li>
</ul>
<span class="nvgt" id="prev"></span>
<span class="nvgt" id="next"></span>
</div>

Auto event tracking help - Google Tag Manager

We have a banner on our website which appears to be placed in a wrapper of sorts. I'd like to trigger an event depending on which banner is being displayed.
I've deployed a click listener across all pages as well as the necessary event tag but I'm at a loss as to what the firing rule should be.
For the first banner I am using the following firing rule:
event > equals > gtm.click
element url > equals > /videos/Finding-the-right-deal/
Can anyone tell me where I am going wrong?
<div id="content-top" class="clearfix">
<div class="content-slider">
<div class="wrapper">
<ul>
<li><a href="/videos/Finding-the-right-deal/">
<img src="Images/banner-video.png" alt="See Country can help you find the right mortgage deal" /></a> </li>
<li><a href="/mortgages/help-to-buy/">
<img src="Images/htb.png" alt="Help to buy" /></a> </li>
<li><a href="/mortgages/" id="ctl00_ConBody_AdPosition1Link">
<img src="Images/whatmortgagewinnerbanner.png" id="ctl00_ConBody_AdPosition1Image" alt="Award winning advice" /></a>
</li>
</ul>
</div>
</div>
<!--content-slider -->
Try chaning the second condition of your rule from equals to contains. gtm.elementUrl returns the complete url, not just the url path.

Twitter Bootstrap, styling & using media-grid class

I am creating a simple(ish) website for one of my iPhone apps using the Twitter Bootstrap project. I have created a full website with this and found it quite easy to use but I am having some issues media-grid.
I am trying to achieve a row of 3 images using the media-grid class. The images are 280px in width which gives me 840px in total. The container is 940px wide so I have 100px grace to use for padding etc. I am finding this extremely difficult to do as when i view the site it puts two images side by side then the third on the next row. Some anomalies are showing up though, which are;
When I publish the index.html and associated css file via FTP the website displays the images with two side by side then the third image on the next row underneath the first.
When I preview the website in 'Coda' (the editor on Mac I am using to write the html and css) the website looks exactly how I want it too with all 3 images side by side in one row.
I have tried a number of things;
I have tried editing the .media-grid styles in the CSS and it doesn't seem to make a difference to how the site looks. Even if I had massive margins or padding it doesn't alter for some reason?
I have tried putting my own id onto the media-grid class for the three images then styling then myself which also has no impact on the visuals.
I have used the following code to insert my images;
<div class="container">
<ul class="media-grid" id="imagearray">
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
</ul>
</div>
Am I missing something in the CSS? I am not fluent with CSS so it is possible I am overlooking something? Any help would be appreciated.
To get the default styling to work correctly you need to wrap the <li>s with an <a href>.
e.g.
<ul class="media-grid" id="imagearray">
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
<li>
<img class="thumbnail" src="img/tweettimemainimage.png" alt="">
</li>
</ul>