I have looked online for this info and have got close but it is not really what I need and Im not sure if it's possible to do or not? so thought I would ask you??
On my main search page, I have lots of HTML link which comes from a database on the server and links to different web sites. ( at the moment the links go directly to there website via the target self)
So what I would like to do is when you click on the link it
loads up a Model popup and iframe with the website itself instead of going directly to there website and leaving mysite. And then press the grey area or X to delete it and then shows the main page.
As I said I got close ie getting the model popup to work but the links would not work
hope you can advise what is the best way to do this?
Thanks
Tim
Use target with name of iframe. Modal should be shown with onClick="showModal()".
Just make sure you have access via CORS to these sites. SO Question about that
function showModal()
{
$('#modal').show();
}
function hideModal()
{
$('#modal').hide();
}
#modal {
position: fixed;
left: 10%;
top: 10%;
height: 300px;
width: 80%;
background-color: white;
display: none;
}
.close {
position: absolute;
right: -5px;
top: -5px;
background-color: white;
border-radius: 50%;
border: 1px solid black;
text-align: center;
}
iframe {
width: 100%;
height: 100%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="modal">
<div class="close" onClick="hideModal()">×</div>
<iframe name="modal_iframe" src="demo_iframe.htm"></iframe>
</div>
Stack Overflow<br/>
W3
Related
Hello
I am building a chat room site, however it runs into a problem on iPhone (or possibly safari I have not checked yet).
When you start typing in the input which is position: fixed to the bottom, the screen zooms in, and you have to manually zoom out to see the send button. I know this was not very explanatory, so I will put my code here:
Sloppy code that works sometimes (except now)
input {
font-size: 150%;
width: 83vw;
height: inherit;
}
form {
position: fixed;
bottom: 0px;
left: -2px;
height: 6vh;
margin-bottom: 0px;
}
form button {
width: calc(17vw + 2px);
font-size: 150%;
position: fixed;
right: -2px;
height: inherit;
}
This is not anything to do with your code. I am a long time iphone user and could say that iphone does this automatically. When the keybord is initiated it automatically zoom to a point where you can see what you are typing effectievly.
I can't get my head around why when I hover over my logo it isn't linked to the landing page.
HTML:
<body>
<header>
<a href="landing.html">
<img src="img/typeface.png" alt="logo" class="headerlogo">
</a>
</header>
<img src="img/wave.png" alt="wave" draggable="false" class="wave">
</body>
CSS:
body {
margin: 0;
padding: 0;
background-color: #121420;
font-family: 'Montserrat', sans-serif;
}
header {
display: flex;
}
.headerlogo {
width: 10%;
height: 55%;
margin-left: 5%;
padding-top: 35px;
}
.wave {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
}
I saw other post stating that the z-index was the problem but I don't have an z-index within my css.
Running your code in a JSfiddle it works just fine (I swapped the image): https://jsfiddle.net/8e0j62zw/
Do you mean like when you click the link it doesn't go anywhere? Just gives you another blank page, or not found error.
If so you might need to check the path on your link to your landing.html
It appears to be a relative path which based on the location of your file could be causing it to break. You can read about path linking here: https://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/
I believe I found the issues the wave image is technically over the top of the entire page although being transparent preventing me from clicking anywhere on the site.
I fixed this problem by applying z-index: -1 to the wave image.
I am creating content cards which need to be clickable. Clicking on these cards take you to the page where you can see the full content. Additionally, for some users, the cards also have links inside which go through different pages (like to edit or report). You can see the desired design here:
https://jsfiddle.net/4s8b5kb1/1/ (the card would go to more details page).
Looking through older questions, I came across methods that either make the card div clickable by adding an onClick handler or having a persistent 'View More' link. Ideally, I am want to just use plain CSS without wanting to add onClick handlers that do the job of links, and not have a persistent 'View More' button either.
I have also read of strategies where you create a link within a div and then using z-index you can let it act as the link for the entire div, and having other more specific links have higher z-index.
I have tried it but with not much luck. Here is the code so far: https://jsfiddle.net/4s8b5kb1/1/
Any ideas are much appreciated!
I put position: relative on edit class
.edit {
color: indianred;
font-size: 1rem;
z-index: 10;
position: relative;
}
You can check it here:
.parent {
display: flex;
justify-content:center;
align-items:center;
height: 100vh;
}
.card {
height: 200px;
width: 260px;
background: #FFF;
border: 1px solid #FAFAFA;
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.12);
border-radius: 20px;
overflow-y: auto;
padding: 2em;
font-family: Courier New;
font-size: 0.7rem;
cursor: pointer;
position: relative;
}
.card p {
z-index: 10;
}
.edit {
color: indianred;
font-size: 1rem;
z-index: 10;
position: relative;
}
.view {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 1;
opacity: 0;
}
<div class ="parent">
<div class="card">
<a class="edit" href="#edit">EDIT</a>
<a class="edit" href="#edit">REPORT</a>
<p>
For those who have seen the Earth from space, and for the hundreds and perhaps thousands more who will, the experience most certainly changes your perspective. The things that we share in our world are far more valuable than those which divide us. As
we got further and further away, it [the Earth] diminished in size. Finally it shrank to the size of a marble, the most beautiful you can imagine. That beautiful, warm, living object looked so fragile, so delicate, that if you touched it with
a finger it would crumble and fall apart. Seeing this has to change a man. When I orbited the Earth in a spaceship, I saw for the first time how beautiful our planet is. Mankind, let us preserve and increase this beauty, and not destroy it!
</p>
<a class = "view" href = "#view">View</a>
</div>
</div>
My question may seem pretty weird but I wanna know if its possible to do somehting like this:
I want to add a text to my website that would fade away when someone points a cursor at it, then I would like a hyperlink to appear in the place of the faded text. I'd also like the reverse effect if the cursor is moved away from the text.
I know that you may not know what I mean so I made a quick (poor quality) vid that kinda shows what I mean
https://www.youtube.com/watch?v=WK8dP5klI14&feature=youtu.be
Thanks in advance.
A very basic example with jQuery.
$(".hover-main").on("mouseenter", function(){
$(".hover-text").fadeOut("fast", function(){
$(".hover-link").fadeIn("fast");
});
});
$(".hover-main").on("mouseleave", function(){
$(".hover-link").fadeOut("fast", function(){
$(".hover-text").fadeIn("fast");
});
});
.hover-main{
width: 200px;
text-align: center;
position: relative;
height: 50px;
line-height: 50px;
background: #000;
color: #fff;
cursor: pointer;
}
.hover-link{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="hover-main">
<div class="hover-text">
Hover to see link
</div>
<div class="hover-link">
Link to Google
</div>
</div>
Hope this helps
I am trying to make a link from an image , means after clicking an image I would like to redirect to another site . I have used the following
<div class="haus">
<img src="http://schwedenladen.de/wp-content/themes/schweden/style/img/haus_icon.png" alt="Haus">
</div>
CSS CODE
.haus {
height: 100%;
margin-left: 50px;
padding: 0 0 5px;
width: 30px;
border:1px solid red;
z-index:999;
}
I am not getting the hyper link icon , when I move mouse over the image
Your image is BEHIND the banner. Try this:
.haus>a {
position: absolute;
z-index: 9999;
}
The z-index is important, since the header has a very high value that needs to be sent to back.