On click load iframe [closed]

Did you inspect your code for any errors? If the error is “Uncaught TypeError: $ is not a function”, then maybe you can add the code as below. <script> jQuery(document).ready(function($) { //your code starts here <iframe id=”myiFrame” class=”stop-lazy” data-src=”https://some.iframe” frameborder=”0″ allowtransparency=”true” style=”width: 100%;min-height: 150px;”></iframe> }); </script>

Translate javascript with WordPress built-in localization API for static strings

wp_localize_script() defines a variable in the global JS scope – in the case of your code, the object is placed in a globally-scoped variable with the identifier MediaFolders. In your load event callback you are also defining a variable with the identifier MediaFolders scoped to it’s encapsulating function body – so when you use the … Read more

Trigger wp-embed via JavaScript to refresh iframe preview?

Unfortunately WP Embed isn’t responsible for converting links into iframes. The conversion of links and shortcodes into iframes is implemented by OEmbed and that happens via OEmbed APIs on the_content filter in PHP, not javascript. It’s much more likely that your transitioning to pages that use raw post content rather than processed/rendered content, e.g. templates … Read more

How to change “““ to “““?

The headings will be defined in many different places, mostly in the theme and in the page content. So using JS as you have will be the most reliable approach. A few things to note about enqueuing scripts: As your script uses jQuery, you need to pass jQuery as a dependency to make sure it … Read more

Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]

Things that present headlines in a horizontal scroll tend to be called tickers. (Probably due to there resemblance to old-school ticker tape printers.) Anyway, try these: http://wordpress.org/extend/plugins/news-ticker/ http://wordpress.org/extend/plugins/wordpress-news-ticker-plugin/ (may not do RSS) http://wordpress.org/extend/plugins/accessible-news-ticker/ They should all do pretty much the same thing, but they will differ in their appearance. If you don’t mind about the … Read more

How to add drag and drop functionalities to a div inside option panel

3 steps: php <?php wp_enqueue_script( ‘jquery-ui-sortable’); html <div class=”metabox-holder”> <div class=”postbox-container”> <div id=”my_div” class=”meta-box-sortables ui-sortable”> <div class=”postbox” id=”el1″> <h3 class=”hndle”><span>title2</span></h3> <div class=”inside”>content1</div> </div> […elements…] <div class=”postbox” id=”el20″> <h3 class=”hndle”><span>title20</span></h3> <div class=”inside”>content1</div> </div> </div> </div> javascript <script type=”text/javascript”> jQuery(document).ready(function(){ jQuery(‘#my_div’).sortable(); });

Load images after page load

I took a look at it on Github: https://github.com/tuupola/jquery_lazyload – it appears that there was some sort of fix that was merged in that helps, though I’m not sure if it really fixes the issue. It appears to work for me as expected in FF6, though my connection is probably not slow enough to really … Read more