Vimeo still playing after froogaloop api unload - zurb-foundation

I'm hosting several vimeo videos in a gallery using foundation 4 framework with Reveal modal as a lightbox effect. Unfortunately the videos continue to play after each modal is closed.
I'm still new to jquery so I used the Froogaloop api (https://developer.vimeo.com/player/js-api) to unload each vimeo video but I'm unable to get it to work.
Here's my code:
//Vimeo Froogaloop API event handler
function ready(player_id) {
var player = $f(player_id),
play = document.getElementById('play'),
pause = document.getElementById('pause'),
unload = document.getElementById('unload');
play.addEventListener('click', function() {
player.api('play');
});
pause.addEventListener('click', function() {
player.api('pause');
});
unload.addEventListener('click', function() {
player.api('unload');
});
}
window.addEventListener('load', function() {
//Attach the ready event to the iframe
$f(document.getElementById('player')).addEvent('ready', ready);
});
HTML:
<!-- //Video Click Event -->
<div class="row">
<div class="large-12 columns">
<div id="myModal3" class="reveal-modal">
<iframe id="player1" src="http://player.vimeo.com/video/62831216?api=1" width="720" height="406" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<a class="close-reveal-modal" id="unload" href="#">x</a>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<p><img src="http://placehold.it/250x100" class="logo"></p>
</div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<!-- //Foundation 4 Accordion -->
<div class="row">
<div class="large-12 columns">
<div class="section-container accordion" data-section="accordion">
<section class="section">
<div class="row">
<div class="large-5 columns"><p class="title"><img src="http://placehold.it/301x248"></p></div>
<div class="large-7 columns">
<p class="title">Name<br> Title</p>
<p class="quote">"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac tempus libero."</p>
</div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="content">
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus malesuada sapien ut nibh porttitor fringilla in sit amet risus. Curabitur euismod viverra elit sed pretium. Suspendisse laoreet tristique convallis. Aliquam erat volutpat. Morbi pharetra lobortis purus non elementum. Pellentesque mattis dignissim lectus in blandit. Duis facilisis vestibulum adipiscing. Suspendisse vulputate viverra consequat. In quis lorem ut tellus fringilla egestas. Etiam semper, dolor ut luctus dapibus, leo nunc scelerisque erat, eget aliquam dolor mauris ut risus. Nam non sem non libero laoreet bibendum quis in mi. Sed non nibh risus. Nunc id nunc felis. Maecenas eu est dui. In tortor justo, facilisis vel pulvinar a, bibendum vel tellus.</p>
</div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns">
<a href="#" data-reveal-id="myModal3" data-animation="fadeAndPop" data-animationspeed="300" data-closeonbackgroundclick="true" data-dismissmodalclass="close-reveal-modal">
<img src="http://placehold.it/720x406">
</a>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns">
<p class="subheader"><b>Client</b><br>
<medium>"Title"</medium><br>
<small>Location</small></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
<div class="row">
<div class="large-12 columns"> </div>
</div>
</div>
</section>
</div>
</div>
</div>

Try using this
<script type="text/javascript">
jQuery(document).ready(function($) {
$('body').live('click',function(){
if($('div.reveal-modal-bg').is(':visible')){
var resourceVideo = $('#myModal iframe').attr('src');
$('#myModal iframe').attr('src','').attr('src',resourceVideo);
};
})
});
</script>

Related

Transition not working when display block and none

HTML
You can see the below code which I am using but transition not working.
<div class="faq">
<input type="radio" id="faq1" class="input" name="faqs">
<label for="faq1">text 1</label>
<div class="answer">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit</p>
</div>
</div>
<div class="faq">
<input type="radio" id="faq2" class="input" name="faqs">
<label for="faq2">text 2</label>
<div class="answer">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit</p>
</div>
</div>
CSS
Here is the CSS that I am using for the transition.
.input, .answer
{
display: none;
transition: all 1s;
}
.faq input[type="radio"]:checked ~ .answer
{
display: block;
transition: all 1s;
}
Transition doesn't work with display none and block property. The reason for this is, display:none property is used for removing block and display:block property is used for displaying block. A block cannot be partly displayed. Either it is available or unavailable. That is why the transition property does not work.
Optionally, You can play with height and opacity, and much better if you are comfortable with javascript. You can make smooth animation with js.
Just in case you want to do this with CSS here is a way to make it work:
.input, .answer
{
opacity: 0;
transition: height 1s, opacity .5s;
background: aqua;
height: 0;
}
.faq input[type="radio"]:checked ~ .answer
{
opacity: 1;
height: auto;
transition: height 1s, opacity .5s;
}
<div class="faq">
<input type="radio" id="faq1" class="input" name="faqs">
<label for="faq1">text 1</label>
<div class="answer">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit</p>
</div>
</div>
<div class="faq">
<input type="radio" id="faq2" class="input" name="faqs">
<label for="faq2">text 2</label>
<div class="answer">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit</p>
</div>
</div>

Match content between words [duplicate]

This question already has answers here:
How do I match any character across multiple lines in a regular expression?
(26 answers)
RegEx match open tags except XHTML self-contained tags
(35 answers)
My regex is matching too much. How do I make it stop? [duplicate]
(5 answers)
Regular expression to get a string between two strings in Javascript
(13 answers)
Closed 4 years ago.
I'd like to create a regex to match content between tags.
My regex that is not working : new RegExp("page.content_before(.+)\/page.content_before", "g").exec(myText)[0]
myText :
page.title
Accueil
/page.title
page.content_before
[slides]
<div>
<div class="line">
<div class="col-12">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit excepturi consequatur inventore alias ducimus tenetur libero iste nesciunt soluta esse et debitis aliquid, voluptatum placeat veritatis! At dolorem repellat doloremque!
</div>
</div>
</div>
<div>
<div class="line">
<div class="col-12">
[articles]
</div>
</div>
</div>
<div>
<div class="line">
<div class="col-12">
[vehicles]
</div>
</div>
</div>
/page.content_before
page.content
<div class="line">
<div class="col-8">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veniam officiis eos quis eum in sapiente aliquid placeat excepturi ratione suscipit quisquam exercitationem necessitatibus totam vel, ullam assumenda optio aspernatur incidunt.
</div>
<div class="col-4">
Social.
</div>
</div>
/page.content
page.content_after
[googlemap]
/page.content_after
page.seo_title
Accueil
/page.seo_title
page.seo_url
accueil
/page.seo_url
The result should be :
[slides]
<div>
<div class="line">
<div class="col-12">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit excepturi consequatur inventore alias ducimus tenetur libero iste nesciunt soluta esse et debitis aliquid, voluptatum placeat veritatis! At dolorem repellat doloremque!
</div>
</div>
</div>
<div>
<div class="line">
<div class="col-12">
[articles]
</div>
</div>
</div>
<div>
<div class="line">
<div class="col-12">
[vehicles]
</div>
</div>
</div>

How to make collapse on clicking heading as well

<div class="box-header with-border">
<h3 class="box-title">ADDRESS</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-plus"></i>
</button>
</div>
how to make collapsible on clicking header div.
its bootstarp collapse:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container">
<h2 href="#demo" data-toggle="collapse">Simple Collapsible</h2>
Simple collapsible
<div id="demo" class="collapse">
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
hope it works
use
data-toggle="collapse" data-target="#collapseExample"
aria-expanded="false" aria-controls="collapseExample"
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/all.js" integrity="sha384-xymdQtn1n3lH2wcu0qhcdaOpQwyoarkgLVxC/wZ5q7h9gHtxICrpcaSUfygqZGOe" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<div class="box-header with-border">
<h3 class="box-title" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">ADDRESS</h3>
<div class="box-tools">
<button type="button" class="btn btn-primary btn-box-tool" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
<i class="fa fa-plus"></i>
</button>
</div>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>

Foundation 6 Mega Menu and Responsive Toggle Navigation with Drilldown Title Bar on Small

I want to create a full-width dropdown mega menu that I can also combine with a top bar that has an drilldown menu in mobile screens. Any method I've tried on Foundation only works with Foundation 5, since they changed top bar in Foundation 6.
So far, (with the help from this thread: http://foundation.zurb.com/forum/posts/36800-f6-and-mega-menus) I have been able to create the dropdown mega menu and on small screens, the title bar appears and toggles open. However, when I try to open an item with a drilldown submenu, it still treats it as though it is a dropdown item.
Also, I am noticing that full-width hover for the submenus are somehow pushing the screen to a lot of extra empty space horizontally. While I can get rid of the extra empty horizontal space by adding a max-width:100% to the dropdown-pane class, the second of my two mega submenus doesn't display full-width correctly when I hover over them. Although in the codepen, they show just fine.
This is the link to the codepen: http://codepen.io/jen188/pen/PzRkbg
This is the code for my header;
<header>
<div class="row columns expanded">
<img src="img/REPLogo.png" alt="Real Estate Promo" class="logo show-for-small-only" />
<div class="title-bar" data-responsive-toggle="main-menu" data-hide-for="medium">
<button class="menu-icon" type="button" data-toggle></button>
<div class="title-bar-title">Menu</div>
</div>
<div class="top-bar" id="main-menu">
<div class="top-bar-left"><a href="index.html"><img src="img/REPLogo.png" alt="Real Estate Promo" class="logo hide-for-small-only" /></div>
<div class="top-bar-right">
<ul class="vertical medium-horizontal expanded dropdown menu" data-responsive-menu="drilldown medium-dropdown">
<li>About Us</li>
<li>Events Calendar</li>
<li class="has-submenu is-drilldown-submenu-parent">
<a href="#" class="dropdown" data-toggle="megamenu-resources">Resources
<div class="dropdown-pane" id="megamenu-resources" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true">
<div class="row column expanded">
<div class="large-9 columns">
<div class="row column expanded">
<div class="large-4 columns">
<ul>
<li><h3>Foreclosure Laws</h3></li>
<li><img src="img/laws.png" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="large-4 columns">
<ul>
<li><h3>Hard Money Lenders</h3></li>
<li><img src="img/coin-stack.png" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="large-4 columns">
<ul>
<li><h3>Real Estate Glossary</h3></li>
<li><img src="http://placehold.it/500x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
</div>
</div>
<div class="large-3 columns">
<ul>
<li><h3>Find a REIA</h3></li>
<li><img src="img/map-icon.png" alt="Click for More Info"/></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<!-- <div class="small-12 large-3 columns">
<ul>
<li>Find a REIA</li>
<li><img src="http://placehold.it/500x250" alt="Click for More Info"/></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div> -->
<!-- <div class="small-12 large-3 columns">
</div>
<div class="small-12 large-3 columns">
<ul>
<li>Hard Money Lenders</li>
<li><img src="http://placehold.it/500x250" alt="Click for More Info"/></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="small-12 large-3 columns">
<ul>
<li>Real Estate Glossary</li>
<li><img src="http://placehold.it/500x250" alt="Click for More Info"/></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div> -->
</div>
</div>
</a>
</li>
<li class="has-submenu is-drilldown-submenu-parent">
<a href="#" class="dropdown" data-toggle="megamenu-property-listings">Property Listings
<div class="dropdown-pane" id="megamenu-property-listings" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true">
<div class="row column expanded">
<div class="small-12 large-3 columns">
<ul>
<li>All Properties</li>
<li><img src="http://placehold.it/1000x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="small-12 large-4 columns">
<ul>
<li>Single Family Properties</li>
<li><img src="http://placehold.it/1000x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="small-12 large-4 columns">
<ul>
<li>Multi Family Properties</li>
<li><img src="http://placehold.it/1000x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
</div>
</div>
</a>
</li>
<li class="has-submenu is-drilldown-submenu-parent">
<a href="#" class="dropdown" data-toggle="megamenu-websites">Get a Website
<div class="dropdown-pane" id="megamenu-websites" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true">
<div class="row column expanded">
<div class="small-12 large-6 columns">
<ul>
<li>Get Started</li>
<li><img src="http://placehold.it/1000x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
<div class="small-12 large-6 columns">
<ul>
<li>Features</li>
<li><img src="http://placehold.it/1000x250" alt="Click for More Info" /></li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam molestie ullamcorper nisl, sit amet tristique est dapibus nec.</li>
</ul>
</div>
</div>
</div>
</a>
</li>
<li>Reviews</li>
<li>Sign In</li>
</ul>
</div>
</div>
</div>
</header>
Just remove width:100%, and max-width:100%,
Instead use width:auto, and left:0px !important and all things work fine.

Mega Menu Dropdowns with Foundation 5 add another sub level

Can someone help me add another sub level to the "Graduate" menu, like in the screenshot below. I have tried a few things, all of which haven't worked.
e.g : Graduate ->(on image section graduate 1,graduate 2,graduate 3)
CodePen Demo
HTML:
<div class="contain-to-grid">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1>Logo</h1>
</li>
<li class="toggle-topbar menu-icon">
<span>Menu</span>
</li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li class="divider"></li>
<li>
University
</li>
<li class="divider"></li>
<li class="has-dropdown">
Programs
<ul class="dropdown m-menu">
<li>
<div class="row">
<div class="medium-4 column">
<h3>Undergraduate</h3>
<ul>
<li>
<i class="icon-circle-right"></i>Admissions
</li>
<li>
<i class="icon-circle-right"></i>Academics
</li>
<li>
<i class="icon-circle-right"></i>Fields of Study
</li>
<li>
<i class="icon-circle-right"></i>Fees and Finance
</li>
<li>
<i class="icon-circle-right"></i>Useful Contacts
</li>
</ul>
</div>
<!--end of .column-->
<div class="medium-4 column">
<h3>Graduate</h3>
<ul>
<li>
<i class="icon-circle-right"></i>Admissions
</li>
<li>
<i class="icon-circle-right"></i>Academics
</li>
<li>
<i class="icon-circle-right"></i>Fields of Study
</li>
<li>
<i class="icon-circle-right"></i>Fees and Finance
</li>
</ul>
</div>
<!--end of .column-->
<div class="medium-4 column">
<h3>Online Learning</h3>
<ul>
<li>
<a href="#"><i class="icon-circle-right"></i>Why e-learning?</a
</li>
<li>
<i class="icon-circle-right"></i>Studies
</li>
<li>
<i class="icon-circle-right"></i>Date & Deadlines
</li>
<li>
<i class="icon-circle-right"></i>Fees and Finance
</li>
<li>
<i class="icon-circle-right"></i>Contact
</li>
</ul>
</div>
<!--end of .column-->
</div>
<!--end of .row-->
<div class="row">
<div class="medium-4 column">
<h3>Read</h3>
<a href="#" class="intro">
<i class="icon-play"></i>
<img src="https://unsplash.it/400/280?image=532" />
</a>
</div>
<!--end of .column-->
<div class="medium-4 column">
<h3>Build</h3>
<a href="#" class="intro">
<i class="icon-play"></i>
<img src="https://unsplash.it/400/280?image=534" />
</a>
</div>
<!--end of .column-->
<div class="medium-4 column">
<h3>Enjoy</h3>
<a href="#" class="intro">
<i class="icon-play"></i>
<img src="https://unsplash.it/400/280?image=452" />
</a>
</div>
<!--end of .column-->
</div>
<!--end of .row-->
</li>
</ul>
</li>
<li class="divider"></li>
<li>
Research
</li>
<li class="divider"></li>
<li class="has-dropdown">
Studies
<ul class="dropdown m-menu">
<li>
<div class="row">
<div class="medium-6 column show-for-medium-up">
<img src="https://unsplash.it/380/220?image=668" />
<div class="info-wrap">
<div class="info info-visible">
<h3>Select your program...</h3>
<p>More info...</p>
</div>
<div class="info">
<h3>Undergraduate Studies</h3>
<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.</p>
</div>
<div class="info">
<h3>Graduate Studies</h3>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto.</p>
</div>
<div class="info">
<h3>Internships</h3>
<p>Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae adipisci velit, sed quia non numquam eius.</p>
</div>
<div class="info">
<h3>Other Studies</h3>
<p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
</div>
<div class="info">
<h3>Useful Contacts</h3>
<p>Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat adipisci velit, sed quia non numquam eius.</p>
</div>
</div>
<!-- .info-wrap -->
</div>
<!--end of .column-->
<div class="medium-6 column">
<h3>Programs</h3>
<ul class="is-hover">
<li><i class="icon-circle-right"></i>Undergraduate</li>
<li><i class="icon-circle-right"></i>Graduate</li>
<li><i class="icon-circle-right"></i>Internships</li>
<li><i class="icon-circle-right"></i>Other</li>
<li><i class="icon-circle-right"></i>Contact</li>
</ul>
</div>
<!--end of .column-->
</div>
<!--end of .row-->
</li>
</ul>
</li>
<li class="divider"></li>
<li>
Student Life
</li>
<li class="divider"></li>
</ul>
</section>
</nav>
</div>
<!--end .contain-to-grid-->
<h2 class="dt">Responsive Mega Menus with Foundation 5</h2>
<p class="p">Demo by George Martsoukos. See article.</p>
jQuery/javascript:
$(document).foundation();
// below does the "Programs" info switch
$('.is-hover a').on('mouseover', function() {
var idx = $(this).parent().index() + 2;
$('.info:nth-child(' + idx + ')').addClass('info-visible');
$('.info:nth-child(' + idx + ')').siblings().removeClass('info-visible');
});
$('.dropdown').on('mouseout', function() {
$('.info:nth-child(1)').addClass('info-visible').siblings().removeClass('info-visible');
});