Note that there are some explanatory texts on larger screens.

plurals
  1. POReturn False not always preventing event
    primarykey
    data
    text
    <p>This is code being used in a shortcode on WordPress. Functionality pretty much self explanatory: it's a simple video gallery - click on a playlist box replaces the html of the main video div with the content from one of the hidden divs.</p> <p>HTML</p> <pre><code>&lt;div class="main-video"&gt; &lt;iframe src="http://player.vimeo.com/video/50781537" frameborder="0" width="630" height="400"&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;div id="video-playlist-wrapper"&gt; &lt;ul class="video-playlist"&gt; &lt;a href="#"&gt;&lt;li&gt;&lt;div class="playlist-video-wrapper"&gt;&lt;div class="playlist-video-title"&gt;Title 1&lt;/div&gt;&lt;div id="playlist-video1"&gt;Desc 1&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt; &lt;a href="#"&gt;&lt;li&gt;&lt;div class="playlist-video-wrapper"&gt;&lt;div class="playlist-video-title"&gt;Title 2&lt;/div&gt;&lt;div id="playlist-video2"&gt;Desc 2&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt; &lt;a href="#"&gt;&lt;li&gt;&lt;div class="playlist-video-wrapper"&gt;&lt;div class="playlist-video-title"&gt;Title 3&lt;/div&gt;&lt;div id="playlist-video3"&gt;Desc 3&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt; &lt;a href="#"&gt;&lt;li&gt;&lt;div class="playlist-video-wrapper-last"&gt;&lt;div class="playlist-video-title"&gt;Title 4&lt;/div&gt;&lt;div id="playlist-video4"&gt;Desc 4&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="playlist-video1-content" class="hidden-video"&gt;&lt;iframe src="http://player.vimeo.com/video/50781537" frameborder="0" width="630" height="354"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;div id="playlist-video2-content" class="hidden-video"&gt;&lt;iframe src="http://player.vimeo.com/video/50697289" frameborder="0" width="215" height="130"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;div id="playlist-video3-content" class="hidden-video"&gt;&lt;iframe src="http://player.vimeo.com/video/50771550" frameborder="0" width="215" height="130"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;div id="playlist-video4-content" class="hidden-video"&gt;&lt;iframe src="http://player.vimeo.com/video/50750012" frameborder="0" width="215" height="130"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>JQuery</p> <pre><code> jQuery(document).ready(function($) { $('#playlist-video1').click(function() { $('.main-video').html($('#playlist-video1-content').html()); return false; }); $('#playlist-video2').click(function() { $('.main-video').html($('#playlist-video2-content').html()); return false; }); $('#playlist-video3').click(function() { $('.main-video').html($('#playlist-video3-content').html()); return false; }); $('#playlist-video4').click(function() { $('.main-video').html($('#playlist-video4-content').html()); return false; }); }); </code></pre> <p>The issue: Sometimes the link event still happens and reloads the page with the href="#" causing a jump to the top of the page and the html is not replaced. Other times it works fine and the main video updates with one of the playlist videos. </p> <p>Why is this happening? I've looked through the code repeatedly and can't find any errors or issues. When I developed this locally with xampp everything worked fine, there were no issues. Now on the WordPress site it is breaking. </p> <p>Is it possible the page is already loading too much Jquery and it's taking the Video Gallery jquery too long to load. Any help appreciated! Thanks.</p> <p>Here is a fiddle: <a href="http://jsfiddle.net/xjpv2/1/" rel="nofollow">http://jsfiddle.net/xjpv2/1/</a>`</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload