Match content between words [duplicate] - regex

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>

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>

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.

Vimeo still playing after froogaloop api unload

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>

using foundation-3.2.2 I want to slide both image and content at a time

I am using foundation-3.2.2 , but I am facing image slider problem, I used both orbit image slider or content slider but its not helpful.
Problem is that on my site I want to slide both image and content at a time , and my html structure is below, you can chack ths http://ipadfeatures.info/yogita/envision.com to maximize and minimize your browser.
<div class="row">
<div class="twelve columns">
<div id="featuredContent">
<div>
<img src="images/illustration/spotlight1.jpg"/>
<div class="data">
<h3 class="textWeight">"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed"</h3>
</div>
</div>
<div>
<img src="images/illustration/spotlight2.jpg"/>
<div class="data">
<h3 class="textWeight">"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed"</h3>
Lorem ipsum dolor sit amet,
</div>
</div>
<div>
<img src="images/illustration/spotlight3.jpg"/>
<div class="data">
<h3>""Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed</h3>
Lorem ipsum dolor sit amet, c
</div>
</div>
</div>
</div>
</div>
Zurb has responded to this topic on this github page.
Unfortunately variable content sliding in Foundation 3 was not what the Orbit slider was planned for, it has been updated in Foundation 4.0 to do so, but in 3 it is not supported.