Tuesday, 15 August 2017

Add click event on dynamic generated elements with jquery

Here is the working jQuery script:

jQuery('#div').on('click', '.class', function() {
//alert("");
});

Add style to div on mouseover effect with query

Here is the working  jquery code:

jQuery("#div").mouseover(function() {
jQuery(this).css({ "background": "#ffffff", "box-shadow": "0 -1px 4px -1px rgba(0, 0, 0, 0.3)", "position": "relative", "z-index": "999999999", "border-radius": "none" }); });

Get Image, Iframe source link on button click with jquery

Here is the working script:

jQuery(".btn").click(function() {
var iframesrc = jQuery(this).find("iframe").attr("src");
var imagesrc = jQuery(this).find("img").attr("src");
});

Show and hide menu navigation on window scroll with jquery

Here is the jquery script for Show and hide menu navigation on window scroll wih jquery :

jQuery(window).scroll(function() { 
if (jQuery(document).scrollTop() > 50) 
{
 jQuery('nav').addClass('shrink'); }
 else 

jQuery('nav').removeClass('shrink');
 }
 });

WORDPRESS: DISABLE WORDPRESS EMOJI

Here it the working code and you need to add this into your functions.php file::

function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}

add_action( 'init', 'disable_emojis' );

Google Map Filter Api Example

Here is Google Map Filter Api Example: