want to hide the iframe until link is clicked - html

I have four links which open on an iframe on that same page. My problem is that the iframe takes the space on page load and I want that it will remain hide until any link is clicked coz in small screen size the same page is loading on that iframe on page load though it working well in big screen size.
Here is my code for opening the iframe :
<ul class="thumbnails">
<li class="span2">
<h6>DELHI :</h6>
A-21/13,Naraina Industrial Area,
Phase II,
New Delhi - 110028.
Tel. No. : 011 - 49807100 / 101
Click Here To View Map
</li>
<li class="span2">
<h6>NOIDA :</h6>
B-25,Sector - 59,
Noida- 201301, UP.
Tel. No. : 0120 - 4904000
Click Here To View Map
</li>
<li class="span2">
<h6>CHENNAI :</h6>
82,Sterling Road,
Nungambakkam,(Opposite Loyola College),
Chennai - 600034
Tel. No. : 044-42664445 /46/49/50, 43447900
Click Here To View Map
</li>
<li class="span2">
<h6>JAIPUR :</h6>
SP-38A,RIICO Industrial Area,
Delhi Road,Kukas,
Jaipur-302028.
Tel. No. : 01426 - 414800, 227515, 227616, 227617
Click Here To View Map
</li>
</ul>
<span style="color: #e15b1f;">For more information contact: counsellor#pearlacademy.com, Toll Free No. 1800 103 3005</span>
And here is the iframe on same page:
<div style="display:none;">
<iframe name="frame" src="#" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="870" height="300"></iframe>
</div>

Now you can do this :focus
As like this
Css
.frame_div{
border:solid 1px red;
width:300px;
display:none;
}
.frame_div iframe{
height:200px;
width:300px;
background:green;
}
.click_iframe{
display:inline-block;
vertical-align:top;
}
.click_iframe:focus + div{
display:block;
}
HTML
<ul class="thumbnails">
<li class="span2">
Click Here To View Map
<div class="frame_div"><iframe name="frame" src="#" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="870" height="300"></iframe></div>
</li>
</ul>
Live Demo

You could add an onclick event to your ul:
<ul class="thumbnails" onClick="document.getElementById('frame').parentNode.style.display=''">
assuming that your iframe id is "frame":
<div style="display:none;"><iframe name="frame" id="frame" src="#" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="870" height="300"></iframe></div>

Related

Why those li tags ain't included in <ul> tag in inspector? URL: https://github.com/Lavitaebella37/Github.git

As you can see from the image below the four Icons which are made by li tag should be included in ul tag, but it shows that it doesn't involve them. Is there any structural error?
<section class="section section--feature">
<div class="summary">
<h2 class="summary__title">Welcome home, developers</h2>
<p class="summary__description">GitHub fosters a fast, flexible, and collaborative development process
that lets you work on your own or with others.</p>
</div>
<div class="video">
<div class="video-ratio">
<iframe width="704" height="396" src="https://www.youtube.com/embed/afvT1c1ii0c"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="tiles">
<div class="inner">
<ul class="clearfix">
<li>
<img src="img/feature-tile__build.png" alt="build">
<h3>For everything you build</h3>
<p>Host and manage your code on GitHub. You can keep your work private or share it with the
world.</p>
</li>
<li>
<img src="img/feature-tile__work.png" alt="work">
<h3>A better way to work</h3>
<p>From hobbyists to professionals, GitHub helps developers simplify the way they build
software.</p>
</li>
<li>
<img src="img/feature-tile__projects.png" alt="projects">
<h3>Millions of projects</h3>
<p>GitHub is home to millions of open source projects. Try one out or get inspired to create
your own.</p>
</li>
<li>
<img src="img/feature-tile__platform.png" alt="platform">
<h3>One platform, from start to finish</h3>
<p>With hundreds of integrations, GitHub is flexible enough to be at the center of your
development process.</p>
</li>
</ul>
</div>
</div>
</section>

Marker position when inframe is in li

I know that it is a simple matter, but nowhere I can find a solution. In the following html code markers of <li> are at the bottom of <inframe> How to do to be in the middle or at the top <inframe> ?
<!DOCTYPE html>
<html>
<body>
<ul style=" list-style-position: inside;">
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
</ul>
</body>
</html>
Thank you in advance for your help.
Give the CSS property vertical-align:middle; to the iframe. This will make the bullet go to the middle of the list.
iframe{
vertical-align:middle;
}
<!DOCTYPE html>
<html>
<body>
<ul style=" list-style-position: inside;">
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
<li> <iframe src="http://www.w3schools.com"> </iframe> </li>
</ul>
</body>
</html>

JQM without iframe

I try build app by JQM and I use widget Navbar, until now I used by IFrame but it works not good.
My question is, what can I replace instead of IFrame ?
<div data-role="navbar" class="nav-glyphish-example">
<ul>
<li>
<a href="#info_tab" class="infoButton ui-btn-active" data-icon="custom"
id="infoMenu"> </a></l`enter code here`i>
<li><a href="#calendar_tab" class="calendarButton"
data-icon="custom" id="calendarMenu"></a></li>
<li><a href="#picture_tab" class="picturesButton" data-icon="custom"
id="pictureMenu"> </a></li>
<li></li>
</ul>
</div>
<!-- End Navigation Bar -->
<!-- iFrames -->
<div id="iFramesDIV">
<div id="info_tab" class="fullScreen ">
</div>
<div id="calendar_tab" class="fullScreen hide">
<iframe id="calendarFrame" src="tab_pickadate/calendar.html"
scrolling="no" frameborder="0" class="fullScreen"></iframe>
</div>
<div id="picture_tab" class="fullScreen hide">
<iframe id="pictureFrame" src="" scrolling="no" frameborder="0"
class="fullScreen"></iframe>
</div>
<div id="buy_tab" class="fullScreen hide">
<iframe id="buyFrame" src="tab_buy/buy.html" frameborder="0"
class="fullScreen"></iframe>
</div>
</div>
<!-- End iFrames -->
</div>
<!-- End Content-->
Please help me :)
To use iframes you will need to include JQM library in the source of Iframe. Try including JQM in "tab_pickadate/calendar.html" path. I also worked with Iframes and JQM together.

Youtube embed iframe, using Chrome I get a black box

I want to embed a youtube video in a bootstrap one page scroll web page, exactly in a carousel video slider.
I have a problem with both Chrome and Firefox (no problem using Safari).
Here is my code:
<section class="videos">
<div class="container">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ol class="carousel-indicators" style="top:125%">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<div class="carousel-inner" style="top:100px;">
<div class="item active">
<div style="text-align:center;">
<iframe width="853" height="480" src="http://www.youtube-nocookie.com/embed/XXXX?rel=0" frameborder="0" allowfullscreen></iframe>
<div class="carousel-caption">
</div>
</div>
</div>
<div class="item">
<div style="text-align:center;">
<iframe width="853" height="480" src="http://www.youtube-nocookie.com/embed/XXXX?rel=0" frameborder="0" allowfullscreen></iframe>
<div class="carousel-caption">
</div>
</div>
</div>
</div>
I get two error:
In my console I get:
Blocked a frame with origin "https://www.youtube-nocookie.com" from accessing a frame with origin "http://www.domain.com". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.
Uncaught Error: Error calling method on NPObject.
The videos, appears as black boxes.
What should I do? Thanks
I'd recommend you using an object for the videos you want to embed in your site instead of the iframe. It has a better web browser independent behaviour and works as well with other video providers that enable sharing (dailymotion, vimeo)
<embed width="756" height="461" style="display: block;" src="http://www.youtube.com/v/nlcIKh6sBtc?autohide=1&version=3?autohide=1&version=3&autoplay=1" type="application/x-shockwave-flash" bgcolor="#000000" scale="scale" allowfullscreen="true" salign="tl" allowscriptaccess="never" wmode="opaque">
The above code snippet is an example of how to share a youtube video on a web page with various parameters. Hope this helped.

Interactive HTML underlay with z-index

Can we make the following Google Map interactive provided the frame image is showing.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<input type="button" onclick="$('#frame_image').show();" value="Show frame layer">
<input type="button" onclick="$('#frame_image').hide();" value="Hide frame layer">
<br /><br />
<div style="position: absolute; z-index: 1;">
<iframe frameborder="0" width="358" height="358" marginheight="0" marginwidth="0" scrolling="no" src="https://maps.google.ca/maps?f=q&source=s_q&hl=en&geocode=&q=55+Avenue+Road,++Toronto,+Ontario+M5R+3L2+Canada&aq=&sll=43.656877,-79.32085&sspn=0.852471,2.113495&ie=UTF8&hq=&hnear=55+Avenue+Rd,+Toronto,+Ontario+M5R+1C6&t=m&z=14&ll=43.67111,-79.395217&output=embed&iwloc=near" ></iframe> <br />
<small>View Larger Map</small>
</div>
<div style="position: absolute; color:red; z-index: 2" id="frame_image">
<img src="http://torontoclinic.awkwardhosting.com/images/frame.gif" />
</div>
Code is also on the following link:
http://jsfiddle.net/pPrZV/
Please let me know if there is any other way via Google Maps API etc.
Thanks
Just apply this style to <iframe> of the google map
<iframe style="border-radius:250px" frameborder="0" width="358" height="358" marginheight="0" marginwidth="0" scrolling="no"...
Working jsFiddle here