Sorry If my tone is not good,
I am using this code in a web page.
HTML:
<a class="second" href="#nav1">Home</a>
<a class="second" href="#nav2">About</a>
<a class="second" href="#nav3">Contact</a>
<section id="nav1" data-speed="4" data-type="background">
<article>Big Tech Ideas Page3</article>
</section>
<section id="nav2" data-speed="4" data-type="background">
<article>Big Tech Ideas Page3</article>
</section>
<section id="nav3" data-speed="4" data-type="background">
<article>Big Tech Ideas Page3</article>
</section>
Question: my question is this, When I click on link "About" of "Contact", page should scroll slowly slowly .
NOTE:(Here I mean Parallax Scrolling).
suggest me css for this.
You're gonna have to modify your HTML. I passed across a solution some time ago but I don't remember where it is. Anyway here's how I'd modify your code:
HTML:
<a id="nav1"></a>
<a id="nav2"></a>
<a id="nav3"></a>
<header class="nav">
<nav>
<ul>
<li>Home </li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<section id="main">
<article class="article" id="nav1">
<p>Big Tech Ideas Page3</p>
</article>
<article class="article" id="nav2">
<p>Big Tech Ideas Page3</p>
</article>
<article class="article" id="contacto">
<p>Big Tech Ideas Page3</p>
</article>
</section>
CSS:
a[id= "nav1"]:target ~ #main article.article {
-webkit-transform: translateY( 0px);
transform: translateY( 0px );
}
a[id= "nav2"]:target ~ #main article.article {
-webkit-transform: translateY( -500px );
transform: translateY( -500px );
}
a[id= "nav3"]:target ~ #main article.article {
-webkit-transform: translateY( -1000px );
transform: translateY( -1000px );
}
header {
position: fixed;
z-index: 10;
}
.article {
width: 100%;
height: 600px;
z-index:0;
-webkit-transform: translateZ( 0 );
transform: translateZ( 0 );
-webkit-transition: -webkit-transform 2s ease-in-out;
transition: transform 2s ease-in-out;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.article p {
font-family: sans-serif;
font-size: 86px;
font-size: 5rem;
position:relative;
line-height: 300px;
text-align: center;
margin: 0;
}
Let me know if it works.
Working demo fiddle: http://jsfiddle.net/Fraximus/CFSEK/1/
Is there any way to produce reverse-parallax scrolling?
i.e. On scrolling the content down, I want the respective title in the left pane to get highlighted accordingly.
Related
I want to hover on image. When I do hover on it the opacity of the image will be decreased and the text will appear on the image. I kinda did something. In my container I have 3 different images which are under same class name. I think that's why when I hover one image other two image is affected .How can I fix it? Sİnce I hve been trying to solve it for a long time, My brain stopped working.
What I want when I hover one image, only that image will be affected. Here is my code. Thanks all
<div class="main-blog-items">
<div class="blog-baslik">
<h4>BLOG & HABERLER</h4>
</div>
<div class="row">
<div class="col-md-4">
<div class="blog-icerik">
<div class="blog-img">
<img src="img/carousel2.jpg">
</div>
<div class="overlay-blog">
<div class="blog-content">Blog Yazısı 1</div>
</div>
</div>
<div class="blog-item-title">
<p>Title</p>
</div>
</div>
.overlay-blog {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.main-blog-items:hover .blog-img {
opacity: 0.3;
}
.main-blog-items:hover .blog-item-title{
opacity: -5;
}
.main-blog-items:hover .overlay-blog {
opacity: 1;
}
use this instead
.blog-icerik:hover {
opacity: 0.3;
}
.blog-icerik:hover .overlay-blog {
opacity: 1;
}
.blog-icerik:hover ~ .blog-item-title{
opacity: 0;
}
I have an accordion.. while opening it is opening slowly but while closing its closing very fasting within fraction of ms range. Kindly help me to change the animation while closing.
I am here by sharing my HTML and css code,
Please help.
HTML Code:
<accordion>
<accordion-group #groupUser class="outer admin">
<div accordion-heading >
ABCD
<i class="pull-right" [ngClass]="{'closeArrow': groupUser?.isOpen, 'openArrow': !groupUser?.isOpen}"></i>
</div>
<div layout="row" class="row listing-element tracking-listing">
<div layout="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">Car</div>
</div>
</div>
<div layout="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">Bike</div>
<div layout="row">
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">Auto</div>
</div>
</div>
</accordion-group>
</accordion>
CSS:
#wd-faq .outer .panel-collapse .panel-body {
margin-top: 18px;
border: 0;
background-color: blue;
-webkit-animation:all 150ms;
overflow:hidden;
}
#keyframes all {
0% {
height:0px;
}
100% {
height:auto;
}
}
The CSS i pasted above is of opening accordion. Help me for Closing accordion.
Thanks in Advance.
Try like this in yout HTML Code
HTML CODE
<accordion>
<accordion-group #groupUser class="outer admin">
<div accordion-heading >
ABCD
<i class="pull-right" [ngClass]="{'closeArrow': groupUser?.isOpen, 'openArrow': !groupUser?.isOpen}"></i>
</div>
<div class="slideInDown">
</div>
<accordion-heading>
<accordion>
and change your CSS with these codes
CSS
.slideInDown{
-webkit-animation-name: slideInDown;
animation-name: slideInDown;
-webkit-animation-duration: 80ms;
animation-duration: 80ms;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
#-webkit-keyframes slideInDown {
0% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
visibility: visible;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
#keyframes slideInDown {
0% {
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
visibility: visible;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
I dont know it satisfies your requirement properly or not but you can try once.
I think the main problem is with the animation. It's not the best choice for the toggle animation. If you check your animation you can see there it is only an open animation. You can use two animation or only one and make it reverse direction with css but it would be pain in the ass and also produce a terrible code. But you can use transition which is works perfectly and it is looks more better and produce less code.
Here is the code:
CSS:
There is an .accordion class which is 0 at the beginning and I have a transition which 2s long. I use max-height because auto won't work and it will be as high as the content when it's opened.
.accordion {
background-color: lightgreen;
max-height: 0;
overflow: hidden;
transition: max-height 2s;
}
.accordion.open {
max-height: 200px;
}
HTML:
In the HTML i have a click event on a button which open the div. It has a toggle function. On the accordion div there is an ngClass with the open class and with an isOpen boolean.
<button (click)="toggle()">OPEN</button>
<div class="accordion" [ngClass]="{'open': isOpen}">
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</div>
TypeScript code:
This is a simple code for checking the state of the accordion.
isOpen:boolean = false;
public toggle() {
if(this.isOpen) {
this.isOpen = false;
}else {
this.isOpen = true;
}
}
And that's all. I hope you understand my English :D.
And here is a WORKING PLUNK.
I've built a simple navigation component for my website, which has left and right swinging 'doors.' These work great in all browsers except for Safari, where the 'door' seems to disappear entirely behind its background when your mouse moves from one door to another. Mousing over one door at a time works fine, as long as you wait for the animation to stop before touching the blue door.
Also, one page of my site has a fixed background video, and on that page the animations do not work at all, the entire div disappears as soon as you hover over it.
I've been working on this issue for quite a while and cannot think of a possible reason for this weird behavior. If I implement the animation without putting it in a bootstrap grid, it works, but once the background video is involved it causes the same problem seen in this codepen.
Thanks in advance for any ideas why this is happening!
HTML:
<head>
<link href="css/bootstrap.css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-6 greenbackground">
<a href="#">
<div class="greenlink doorleft">
<h1>Left Swing Link</h1>
</div>
</a>
</div>
<div class="col-xs-6 bluebackground">
<a href="#">
<div class="bluelink doorright">
<h1>Right Swing Link</h1>
</div>
</a>
</div>
</div>
</div>
<body>
CSS:
.greenlink{
width: calc(100% + 30px);
padding-top:5em;
padding-bottom:5em;
text-align:center;
background-color: lightgreen;
margin-left:-15px;
}
.greenbackground{
background-color: green;
}
.bluelink{
width: calc(100% + 30px);
padding-top:5em;
padding-bottom:5em;
text-align:center;
background-color:lightblue;
margin-left:-15px;
}
.bluebackground{
background-color:blue;
}
.doorleft{
transition: all 500ms ease;
transform: perspective(900px) rotateY(0deg);
transform-origin: 0% 0%;
-webkit-transform-style: preserve-3d;
}
.doorleft:hover {
transform: perspective(1000px) rotateY(30deg);
}
.doorright {
transition: all 500ms ease;
transform: perspective(900px) rotateY(0deg);
transform-origin: 100% 0%;
-webkit-transform-style: preserve-3d;
}
.doorright:hover {
transform: perspective(1000px) rotateY(-30deg);
}
Here's the link to a codepen: https://codepen.io/anon/pen/RgBdJp
I have no idea why, but giving .col-xs-6 position: static solves it (bootstrap gives it position: relative). In this case it doesn't affect anything else so should be ok. Clearly it's a Safari issue.
I'm searching a way to make an css effect but with exception of not applying the effect to the letters and the buttons (Only to the image), so I need create a rule in css. I can't change the order of the things.
With my code, I get something like this.
This is my code, like you can see I applied some effect in css and this is getting applied to all. I only need it for the image.
.myimage01 {
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.myimage01:hover {
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01" data-style="background-image: url(http:www.myurl.com/image.jpg);padding: 40px 30px ;color: #ffffff;text-align: center;">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>
When I apply the effect apply the effect to the letters (h5, h3, p and the button with btn class)
I don't want the effect for them, only for the background-image.
How can I do?
for transition backgrounds use the property background-size, and use background-position to adjust as fits you better
body {
margin: 0
}
.myimage01 {
background-size: 100%;
background-position:center center;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
background-image: url(http://lorempixel.com/1600/900);
padding: 40px 30px;
color: #ffffff;
text-align: center;
}
.myimage01:hover {
background-size: 130%;
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>
Use background-size for transition:
div {
background-image: url(http://lorempixel.com/400/200/sports/1/);
background-size: 100%;
background-repeat:no-repeat;
background-position:50% 50%;
width:400px;
height:200px;
transition: background-size 200ms linear;
text-align:center;
line-height:200px;
}
div:hover {
background-size: 120%;
}
<div>
Some text
</div>
try to transform the background-size property instead of scaling the whole container.
You can apply transform on background-size, background-position to get the effect on the background image.
.myimage01 {
background-size:100%;
background-position:0px 0px;
-webkit-transform: all;
transform: all;
-webkit-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.myimage01:hover {
background-size:140%;
background-position:-50px -50px;
-webkit-transform: all;
transform: all;
}
<li id="armonioso-text-2" class="widget widget_armonioso_text">
<div class="armonioso-textwidget-wrapper armonioso-textwidget-no-paddings">
<!-- Here I'm currently Applying the efect -->
<div class="armonioso-textwidget myimage01" style="background-image: url(http://dummyimage.com/600x200/000/fff);padding: 40px 30px ;color: #ffffff;text-align: center;">
<h5>hello world</h5>
<h3>Here how works</h3>
<p>Take a look of new things
<p><a class="btn alt" href="about/index.html" target="_self">About me</a>
</div>
</div>
<!-- Here I'm currently Applying the efect -->
</li>
Here's my site:http://vani.valse.com.my/schone_lightings/index.php.
When I use offcanvas menu for mobile version , any links on the page become unclickable. I thought it's something to do with z-index but it doesn't change anything. Can anyone tell me why this happens and how to fix it plz?
My css
.off-canvas-fixed {
-webkit-transition: -webkit-transform 500ms ease;
transition: transform 500ms ease;
height:100%;
}
.move-right > .off-canvas-fixed {
-webkit-transform: translate3d(15.625rem, 0, 0);
transform: translate3d(15.625rem, 0, 0);
height:100%;
}
.left-off-canvas-menu {
-webkit-transform: none;
transform: none;
margin-left: -15.625rem;
height: 100%;
}
.main-section {
padding:45px 0 0;
}
.tab-bar {
width:100%;
}
#media only screen and (orientation:landscape) and (max-width: 64em){
.main-section {
padding:0 0 0 2.8125rem;
}
.off-canvas-fixed {
width:2.8125rem;
height:100%;
background:#333333;
}
section.left-small{
border:none;
box-shadow:none;
}
}
/*remove opacity for mobile*/
#media all and (max-width : 40em)
{
.row { opacity : 1; }
.cart,.search,.myModal,.reveal-modal {margin-top:50px;}
}
My HTML
<!-- Off Canvas Nav ----------------------------------------------------------------------------------------------------->
<div class="off-canvas-wrap">
<div class="fixed off-canvas-fixed hide-for-large-up"> <a class="exit-off-canvas"></a>
<nav class="tab-bar">
<section class="left-small"> <a class="left-off-canvas-toggle menu-icon" href="#"><span></span></a>
</section>
<section class="show-for-portrait right tab-bar-section">
<h1 class="title">Logo</h1>
</section>
</nav>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li class="show-for-small">
</li>
<li>home</li>
<li>product</li>
<li>help</li>
<li>contact</li>
<li>login/sign up</li>
</ul>
</aside>
</div>
<div class="inner-wrap"> <a class="exit-off-canvas"></a>
</div>
</div>
EDITED:
I removed opacity control for mobile then the links are working except for the search link at the very top. However I need to remove opacity and make all links working.
/*remove opacity for mobile*/
#media all and (max-width : 40em)
{
/* .row { opacity : 1; } */
.cart,.search,.myModal,.reveal-modal {margin-top:50px;}
}
.off-canvas-fixed class has height:100%; it covered your webpage.