Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a css ease on mouse out #2

Open
oncebot opened this issue Jun 5, 2015 · 4 comments
Open

Add a css ease on mouse out #2

oncebot opened this issue Jun 5, 2015 · 4 comments

Comments

@oncebot
Copy link

oncebot commented Jun 5, 2015

I think there is no transition on mouse out, it just goes straight back to the initial state without any transition, it may be a small issue but could increase the experience a lot.

@Tusko
Copy link

Tusko commented Mar 19, 2016

.tilt * {transition: all .25s ease 0s} @Biraj007

@P4KM4N
Copy link

P4KM4N commented Mar 26, 2016

It make everything lag

@dazmillion
Copy link

Hi, am having problems getting this to work on a wordpress site. I think the issue has to do with tiltfx.js code.

I believe it grabs the image directory path from .tilt-effect on the index.php page and injects it into tilt__back/Tilt__front.

But the problem is that when when the tiltfx.js file is in the "website/js/tiltfx.js" location, it doesnt inject the correct img directory path for this.tiltImgBack.style.backgroundImage = 'url(' + this.el.src + ')', which is in the folder "website/images/logo.js"

The effect only works if I paste the tiltfx.js code on the index.php page as a <script></script>, then its able to grab the correct directory path to the image. But when the tiltfx.js file is in the website/js/tiltfx.js location the effect doesnt work because the img directory path its grabbing is not correct.

@oldeback
Copy link

not the best soloution, but it works, and the lag is gone.

inside the javascript file, find the function with the comment
"// reset all when mouse leaves the main wrapper."

and add these two lines to that function:

			el.style.WebkitTransition = '100ms ease-out';
			el.style.transition = '100ms ease-out';

this will ease it with fewer lags than the soloution Tusko wrote.

now add this function under the one mentioned above. it's almost the same function, but i changed the "mouseleave" to "mouseover" instead.

	this.tiltWrapper.addEventListener('mouseover', function(ev) {
		setTimeout(function() {
		for(var i = 0, len = self.imgElems.length; i < len; ++i) {
			var el = self.imgElems[i];

			el.style.WebkitTransition = '0ms ease-out';
			el.style.transition = '0ms ease-out';
		}	
		}, 60);
	});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants