I am in NO SHAPE or form a coder, but have made some tweaks to my BigCartel site that is expected to come out in the next few weeks. I have a clothing line, and I wanted enable consumers who have selected a product, to be able to hover over the image of the product to view it magnified... (here is an example from Nike of what I mean: http://store.nike.com/us/en_us/pd/breathe-womens-short-sleeve-running-top/pid-11319700/pgid-11619220 ) I wanted to know what code to use to make the image/product that a consumer has clicked on and is viewing larger/magnify when hovering over a certain area... I saw some codes uploaded, but SINCE I am not a professional coder, I was wondering WHERE to insert it in the custom coding . I have a CSS option, and HTML and I don't know if I should go to "Products" or the over all coding...(Sorry for the rookie question)...
I also want to know (If I can slide this question in there as well) How to speed up the speed of the slide show on my BigCartel site, and possibly even change it to a dissolve option... And, again, where would I insert that code..
I've made some minor changes on my own, but again, I am NO CODER and there are a few additional tweaks, I would love to make to not make my site so "cookie cutter" The good folks at BigCartel, sent me this link to search and ask questions on. Thanks so much in advance for your help!
Have you tried this this always works for me https://codepen.io/ccrch/pen/yyaraz
JS
$('.tile')
// tile mouse actions
.on('mouseover', function(){
$(this).children('.photo').css({'transform': 'scale('+ $(this).attr('data-scale') +')'});
})
.on('mouseout', function(){
$(this).children('.photo').css({'transform': 'scale(1)'});
})
.on('mousemove', function(e){
$(this).children('.photo').css({'transform-origin': ((e.pageX - $(this).offset().left) / $(this).width()) * 100 + '% ' + ((e.pageY - $(this).offset().top) / $(this).height()) * 100 +'%'});
})
// tiles set up
.each(function(){
$(this)
// add a photo container
.append('<div class="photo"></div>')
// some text just to show zoom level on current item in this example
.append('<div class="txt"><div class="x">'+ $(this).attr('data-scale') +'x</div>ZOOM ON<br>HOVER</div>')
// set up a background image for each tile based on data-image attribute
.children('.photo').css({'background-image': 'url('+ $(this).attr('data-image') +')'});
})
HTML
<div class="tiles">
<div class="tile" data-scale="1.1" data-image="http://ultraimg.com/images/0yS4A9e.jpg"></div>
<div class="tile" data-scale="1.6" data-image="http://ultraimg.com/images/hzQ2IGW.jpg"></div>
<div class="tile" data-scale="2.4" data-image="http://ultraimg.com/images/bNeWGWB.jpg"></div>
</div>
CSS
#import url(http://fonts.googleapis.com/css?family=Roboto+Slab:700);
body {
background: #fff;
color: #000;
margin: 0;
}
.tiles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.tile {
position: relative;
float: left;
width: 33.333%;
height: 100%;
overflow: hidden;
}
.photo {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
transition: transform .5s ease-out;
}
.txt {
position: absolute;
z-index: 2;
right: 0;
bottom: 10%;
left: 0;
font-family: 'Roboto Slab', serif;
font-size: 9px;
line-height: 12px;
text-align: center;
cursor: default;
}
.x {
font-size: 32px;
line-height: 32px;
}
Related
I have an image with an icon on top if it:
<font-awesome-icon class="icons bookmark" icon="fa-solid fa-bookmark"></font-awesome-icon>
<img :src="images[0]" #click.native="visit(l._id)" />
But on mobile devices, it ALWAYS clicks the image behind the icon. Is there a way to prevent this?
Here are my CSS classes:
<style scoped>
img {
border-radius: 25px;
margin: 8px;
width: calc(100% - 50%);
}
.icons.bookmark {
font-size: 1.5em;
z-index: 100;
position: absolute;
top: 20px;
left: 1em;
}
.icons.bookmark:hover {
color: green;
}
</style>
here it is on the image:
Set pointer-events: all on the icon. Check it out on the mdn web docs.
I am not sure if this will solve your problem, because you said it only fails on mobile devices, but give it a try.
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 fix a CSS issue, there's and "i" icon image on which the hovering effect is placed. As the mouse moves over it the tool-tip should appear. But the problem is that tool-tip appears but its fixed on one place there are many "i" icons and as we hover on each due to the tool-tip being displayed in one place, hovering on some "i" images is useless as the tool-tip is not visible. These "i" images are placed in an iframe plus there are many "i" icons so scroll-bar appears so the more bottom of the iframe we reach the tool-tip is not available. Any suggestions and help? Only pure CSS no JS, jquery...says my boss.
The "i" image code:
<div class="sa_statusIn"> Reward Earned
<span id="sa_status8">
<img class="sa_status_tooltip" src="i_image_link.png" alt="help" value="help" width="15" height="15" border="0"><br> Claim Reward <span id="sa_tooltiptxt">Congrats! Another Company system is up & running and we have you to thank. Continue to earn rewards by sharing Company with more of your friends.</span></span>
Claim Reward <span id="sa_tooltiptxt">Congrats! Another Company system is up & running and we have you to thank. Continue to earn rewards by sharing Company with more of your friends.</span></span>
</div>
And here's the relevant CSS:
.sa_statusIn {
float: left;
width: 29%;
padding: 16px 0 0 24px;
color: #C25A59;
}
img.sa_status_tooltip {
width: 19px;
height: 18px;
position: relative;
top: 4px;
left: 5;
}
img.sa_status_tooltip {
width: 19px;
height: 18px;
position: relative;
top: 4px;
left: 5;
}
#sa_tooltiptxt {
display: none;
background: ffffcc;
margin-left: 145px;
margin-top: 0px;
padding: 3px 0px 9px 3px;
position: absolute;
z-index: 1000;
width: 115px;
height: 10px;
}
Regards.
I used below code for customize the file input type,
<form class="example" action="#">
<!--<input type="file" class="required-entry filename file" name="filename[]" />-->
<div class="fileinputs">
<input type="file" class="file hidden">
<div class="fakefile"><input><img src="ravi/images/button_select.gif" /></div></div>
</form>
style.css
<style type="text/css">
body{
color: black;
font-family: arial;
font-size: 13px;
}
form.example input {
background: url('ravi/images/input_boxes.gif') no-repeat 0 -58px;
border: none;
width: 241px;
height: 20px;
padding-left: 3px;
padding-top: 3px;
}
form.example input:focus {
background-color: transparent;
}
form.example div.fileinputs {
position: relative;
height: 30px;
width: 300px;
}
form.example input.file {
width: 300px;
margin: 0;
}
form.example input.file.hidden {
position: relative;
text-align: right;
-moz-opacity:0 ;
filter:alpha(opacity: 0);
opacity: 0;
z-index: 2;
}
form.example div.fakefile {
position: absolute;
top: 0px;
left: 0px;
width: 350px;
padding: 0;
margin: 0;
z-index: 1;
line-height: 90%;
}
form.example div.fakefile input {
margin-bottom: 5px;
margin-left: 0;
}
</style>
and the page display like below,
when i click select button the browse folder appears and then i select the image file.but in input filed the uploaded image caption not displayed..
i integrated this one from http://www.quirksmode.org/dom/inputfile.html
what is the issue?
You need to add JavaScript code as explained on the page you cited.
If the code you use in testing consists essentially of the HTML and CSS code that you posted, then you are using the “pure CSS” version of the approach described on the page. In the numbered list that explains the basic version, which uses JavaScript too, item 5 describes the feature that is missing from the “pure CSS” version. And that feature is “When the user has selected a file, the visible, fake input field should show the correct path to this file”.
(It won’t actually show the correct path. For security reasons, browsers don’t disclose the real path. But they do let you show the filename part.)