Jquery Flipcard Animation to flip on toggle event - javascript

I have a simple jquery flipcard animation - http://jsfiddle.net/gGAW5/36/
Now the way this flip card works is it shows the top div, and hide all divs below it. IF you click on a link in the first div, it flips to the second div andsoforth.When it gets to the last div, it flips back the the first one again on clicking an anchor tag. Now I want 3 anchor tags on the front flip card(first div) and each link(a tag) should have its own back flip card/backsideDiv. currently, in my example, when you click on the first link, it loops through the other 2 links' backsideDivs/flipcards as well. I want it to go back to the main front div again(not flipping to the other links' backflip divs).
So each set of anchor tag/back div pair should operate independently. Hoped I explained it well enough.
I would really appreciate any help
Thank You

There isn't much of easy use of functions for quickFlip... This isn't pretty, but I think I got what you're looking for or at-least close. http://jsfiddle.net/2WbYG/10/

Related

Move element from one parent to another with animation

I'm trying to create a custom carousel. The way it works is that the items are contained in two "piles", both piles contain the same items.
When you click the "next" button, the topmost item from the second pile moves to the top of the first pile. The last item in the first pile will then move to the bottom of the second pile, meaning both piles always contain the same number of items.
When clicking the "prev" button it needs to perform the reverse animation.
When moving items from the second pile to the first, this needs to happen with an animation.
I created a fiddle here https://jsfiddle.net/n109rpp0/3/ with the HTML I have produced so far, but I am struggling to work out a way to do the animation.
I'm not sure if I've taken the right approach, e.g. by having the items duplicated in two ul elements. Also how do I ensure the items are cycled in the correct order?
Does anyone have any ideas on how I should go about this?
Here is a quick idea how to achieve what you want. Add this:
$(prevItem).animate({left: '-345px', top: '-30px', width: '+=50px', height: '+=50px'});
$(prevItem).css('zIndex', '1');
to your next button functionality.
You need to play with the code to make perfect transition.
Here is an updated fiddle
Google animate function for jQuery and you will find more examples

jquery addclass to next div and remove it from actual div

I would need to implement some sort of news slider. this is how it should work:
a container div
3 absolute positioned divs with different z-index to have them stacked one on top of the other (the visibility should be one at a time)
a button which will add a class to the NEXT div in line (i will manage the visibility with css3)
here's my fiddle: http://jsfiddle.net/omegaiori/xqLXt/ and my actual js
var parentheight = $("#wrapper").parent().height();
$(".wrap").height(parentheight);
$('button.mybutton').click(function() {
$(this).next('div').addClass('next');
})
the actual js give the class .next to the first div .. what i want it do is to give the class "next" to the second div on the click of the button removing it from the first div. on the next click the class shall be removed from the second div and switched to the third.
if there's no more divs, it should go back adding it to the first one.
is it possible?
thank you so much guys! :)

jQuery - Only Call The Hover Out Function if Cursor Isn't Entering Any Siblings

I'm trying to create an effect similar to the navigation on this site: http://rogwai.com/. I'm fairly close as you can this in this jsFiddle.
It's working fine if you hover into one li at a time (i.e. from the bottom). If however, you slide horizontally through each list item the 'follower' returns to the active position or slides of the end after each item that's hovered over. Instead it should follow the mouse.
Looking at the code executed on hover out this is completely understandable. What I can't get my head around is how to make it only return to the active position or slide off the end when the mouse completely leaves the menu.
Hopefully that makes sense - you should see the problem straight away from the jsFiddle.
Thanks in advance.
What you can do is add the mouseenter part to the li as you have it, but put the mouseleave part on the entire ul. This way, the leave will only fire when you mouse out of the entire ul.
http://jsfiddle.net/YZr5b/6/
$('nav.block-system-main-menu ul li:not(.follower)').mouseenter(function() {
followerMove($(this));
});
$('nav.block-system-main-menu ul').mouseleave(function(){
followerMove($active);
});
Note, if you are really using jquery 1.2.6 (quite old), you will need to modify this a bit as mouseenter and mouseleave do not exist.

Inserting DIVs from right with slick effects

I was wondering how to make a script that pushes in Divs from the right of my screen.
These Divs are floating right, so when there are too many on one row they one that is longest on the row (one on the left) hops to the next row.
But I want a function that adds a div (just outside of the screen) and pushes it into the screen.
Any idea's ?
Mocked up a demo for you http://jsfiddle.net/rW5rC/3/
Allows you to add a new element on button click which starts invisible offscreen and slides in.
I suggest you to use jQuery, then you can prepend or append certain container
so if you want to insert div in one container at the start use
$('#id_of_container').prepend('<div class="left">my div</div>');
if you want to add it at the end
$('#id_of_container').append('<div class="left">my div</div>');
its much easier to manipulate html with the jQuery, and you don't have to change your code for different browsers.
Use jQuery animate method, it's very simple to do:
$("div").animate({
left: 200
});
I made you a demo here:
http://jsbin.com/ububer

error offset().left in null or not an object [duplicate]

I have a menu system made up of divs and i want to animate the left property to slide each time the user mouses over a menu item but i need the outer div(which is black) element to expand as the menu items move left to right also I want the div element(.container) to slide back and contract the outer div element(this black div which is 0 width) I have a basic example done in jsFiddle it olny moves the elements to the left
Having a little trouble fully understanding, but is this sort of what you mean?
http://jsfiddle.net/V3RHr/2/
If I could rewrite your html a bit, I would put make each .menu-item into an unordered list.
When you mouseenter the unordered list, you expand the second container. Inside that mouseenter function, I would have a second event when you mouseenter a list item, you populate the second container and stopPropogation.
You could probably still do it with a mouseenter on the first container, and another mouseenter on the div.menu-item, but your first container has extra height and width.
You should be able to fix the left is null issue by having the code not execute on the last .content, like this:
$('.container').not(':last').find('.menu-item').mouseenter(function () {
This will not apply to the menu-items within the green box.
For the re-show issue, I would change the way you are showing. Instead of sliding the box out from behind the other, you can position it where you want it to end up and hide it, then you can use:
.animate({width: 'show'})
Which will give a similar sliding effect.
That, or do it similar to my response to your other question, only without the collapsing I had previously:
http://jsfiddle.net/V3RHr/3/

Categories