Google Maps not loading on 2nd panel/page - google-maps-api-3

I am struggling to load Google maps on anything other than the first page.
In the example I have Google maps on page two; but when I move the code to page one, it is working.
Why is this not loading correctly on page two?
code which i move:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3&sensor=false"></script>
<div id="map_div" style="height: 400px;"></div>
http://jsfiddle.net/Spytter/4mtyu/1202/

i have created a new fiddle to show the page not loading, then when button clicked re-size the map.
enter code herehttp://jsfiddle.net/Spytter/4mtyu/1302/

Related

how to hide half the homepage with a show more button WORDPRESS

So I have been searching for a good plugin but was unable to find any - On the homepage of the WP website that I am working on, I want to hide half the page and want to add a button and in middle of the page at the end of the first half that would say "Show More" - When the visitor clicks that button, the rest of the page should show. The button would then go to the end of the page saying "Show Less". The page is static and is just some text and images, nothing complex.
You can do this putting a html block and writing:
<!--nextpage-->
you can read more about this on:
https://codex.wordpress.org/Styling_Page-Links
and to get other solutions you can try:
https://es.wordpress.org/plugins/automatically-paginate-posts/
https://es.wordpress.org/plugins/sgr-nextpage-titles/
https://es.wordpress.org/plugins/page-links-single-page-option/
I hope this will help you to get what you want.
You must create a div with css display none. And then in your html code put an element with a jquery behaviour to display the previously div created. It will be something like:
$(document).ready(function(){
$('#show_content_button').click(function(){
$(this).hide();
$('#content_hide_on_home').show();
});
$('#hide_content_button').click(function(){
$('#show_content_button').show();
$('#content_hide_on_home').hide();
});
});
#content_hide_on_home { display:none; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<p>Text on home</p>
Show content
<div id="content_hide_on_home">
Your extra content on home
Hide content
</div>
I hope this is what you're searching.

MailChimp subscribe popup not displaying but displaying after admin login

I am using MailChimp subscribe popup on my Wordpress website. I am getting one issue. I added the below code on my website.
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/unique-methods/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
<script type="text/javascript">window.dojoRequire(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us5.list-manage.com","uuid":"e47ee5fe210b931aa5a748840","lid":"2b074a0a8b","uniqueMethods":true}) })</script>
I am not getting the popup on my website but if I log in to the WordPress and refresh the page then I am getting the popup.
I checked in the console I am getting the error
TypeError: window.dojoRequire is not a function
Sounds like a load order issue. Try moving those lines to the footer - before the body close tag.

Web Essentials not showing in Browser

After the weekend, web essentials doesn't show in the browser anymore. However building Less files, CSS autosync, etc is still working, just this great bar stays hidden.
I searched google it, and it is not just hidden, it's not rendered in the DOM, only
<script type="application/json" id="__browserLink_initializationData">
{"appName":"Chrome","requestId":"5c9092ee0b964487b663037c2de3f322"}
</script>
<script type="text/javascript" src="http://localhost:1216/d155929549b34e279886e90ecc111382/browserLink" async="async"></script>
How can I make the bar visible again / which additional information can I porovide to solve this?
It maybe you have hidden it by mistake try pressing Ctrl
From the docs
If you don't care to see the menu all the time, check this checkbox to make it be invisible by default. To toggle visibility of the menu, just click the Ctrl key in the browser.

Using Foundation reveal modals with YouTube iframe lazy load lazyYT

I am creating a site which contains multiple YouTube iframes that appear within Zurb Foundations reveal modals. The finished version of the site will have around 30 videos which will create a heavy load and will deteriorate the page speed. To counter this I was planning to use lazyYT.js to lazy load the videos It all works great on the first load, however after opening a modal and finishing playing then closing the modal the video will restart and play in the background.
I have tried multiple variations in lazy loading with no success. I assume the problem is with reveal not terminating the iframe correctly or that the lazy load gets triggered incorrectly.
Fiddle
http://jsfiddle.net/j43aepqh/6/
HTML:
<!-- Triggers the modals -->
Example Modal w/Video…
<div id="videoModal" class="reveal-modal large" data-reveal="">
<h2>This modal has video</h2>
<div class="flex-video widescreen vimeo" style="display: block;">
<div class="js-lazyYT" data-youtube-id="_oEA18Y8gM0" data-width="560" data-height="315" data-parameters="rel=0"></div>
</div>
<a class="close-reveal-modal">×</a>
</div>
<!-- Reveal Modals end -->
<script>$(document).foundation();</script>
<script>$('.js-lazyYT').lazyYT();</script>
This is driving me mad as I can't get my head around what is happening and how to resolve the issue.
Is this the correct valid way of posting videos on a site? I am open to any other methods of posting multiple videos on a single page using a modal and YouTubes iframe embed without causing serious page speed problems.
Are there any good scripts for deferring the load of iframes or a way to load them one by one?
Any help or suggestions would be appreciated.
p.s first time using stackoverflow, hope I'm doing it right
I experienced the same problem. I was able to get lazy loading to work using a different script, found here: http://www.labnol.org/internet/light-youtube-embeds/27941/
Let me know if it works for you!
Brent
I have just been dealing with a situation that may be similar. I have thumbnails of 30 or so videos on my homepage and when one is clicked on, a modal window is opened with the iframe video inside.
Previously, I was having large page load times as all the modal windows were being loaded with iframes inside on page load. I also tried js-lazyYT but ran into issues with videos playing after modal closure. I dealt with this in the following way:
HTML
<!-- Image link to modal -->
<div class="small-12 medium-4 medium-pull-8 columns">
<a class="youtube-modal-reveal" data-reveal-id="{{ videoWorkshop.vID }}">
<img src="http://img.youtube.com/vi/{{ videoWorkshop.vID }}/sddefault.jpg">
</a>
</div>
<!-- Modal -->
<div id="{{ videoWorkshop.vID }}" class="reveal-modal large" data-reveal="">
<div class="flex-video">
</div>
<a class="close-reveal-modal">×</a>
</div>
JS
(function() {
$(".youtube-modal-reveal").each(function( index, element ) {
// Use the one function as we only need to load the video once, even if they visit the modal multiple times
$(element).one( "click", function() {
var id = $(this).attr("data-reveal-id");
var flexVideoContainer = $("#"+id).children(".flex-video");
$(flexVideoContainer).html("<iframe src='//www.youtube.com/embed/" + id + "?rel=0' frameborder='0' allowfullscreen></iframe>");
});
});
})();
I would assume you're wanting to do the lazy loading on modal open. Try the following (inside a $(document).ready(...) block):
$(".reveal-modal").on("opened", function () {
$(this).find(".js-lazyYT").lazyYT();
});
You might also want to destroy the loaded object on close, too.
$(".reveal-modal").on("closed", function () {
// Implementation left to reader
});

YouTube button for the website

I went to https://developers.google.com/youtube/youtube_subscribe_button#Configuration_Options to create YouTube Subscribe button, but for some reason instead of buttons I could choose from I see gray boxes and there is no code shown. Please help
Thank you!
The basic code, test it on your web page :
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channel="GoogleDevelopers" data-layout="default" data-count="default"></div>

Resources