views – How to Add Active class on click of link

I have created a view of taxonomy term. In View’s field area added Taxonomy name and ID(Exclude from display). In field-> Name’s configuration details Overriding output of this field in rewrite area eg. {{ name }}, And selected output this field as custom link. So my question is How can I add active class on it. Because in UI after click on Name its navigating to other page(that is given in output link path) and page is getting refreshed.

views

angular7 – ERROR TypeError: Cannot read property ‘piece’ of null event click

             <li
                *ngIf ="element.backSoon === '0'" 
                class="size-list-element"
                role="option"
                (click)="sizeSelected($event, element)">
                    <a href="#" class="size-list-element-link">
                            {{element.name}}

                    </a>
                </li>

Tengo un click en el elemento li y un enlace dentro. Mi problema es que deseo hacer un event.stopPropagation() y event.preventDefault() en su funciĆ³n pero salta el error:

introducir la descripción de la imagen aquí

Y el motivo es al pasar ese event.

magento2.3 – How to Get More Image when Click on Load More Button?

im uses Instagram Feed Mageplaza Extension,
i do some customization in this extension, i add new button “Load More” from front-end where instagram images are display,also im code a custom jquery to load more images but its not work,

Here is Instagram.phtml file code, in this file i add Load More… Button n HTML, and at Last Add new JQuery

<?php
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_InstagramFeed
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */

/** @var MageplazaInstagramFeedBlockWidget $block */
if ($block->isEnable()) :
    $widgetId = uniqid('-', false);
    $options = $block->getAllOptions();
    $total = $options('total_number');
    $calcWidth = $block->calcWidth();
    $width = $block->getNumberRow($options('layout')) ? $calcWidth . '%' : $calcWidth . 'px';
    $sizeIcon = ($calcWidth < 10) ? '10px' : '20px';
    ?>
    <div class="mpinstagramfeed-container insta-sec">
        <div class="mpinstagramfeed-header">
            <h3><?= /** @noEscape */ __($block->getData('title')) ?></h3>
            <div><?= /** @noEscape */ __($block->getData('description')) ?></div>
        </div>
        <div id="mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?>" class="row shuffle">

        </div>      
        <div class="button-main"><div class="load-more-text"><a href="#" id="loadMore">Load More...</a></div><div class="link-text"><a href="https://www.instagram.com/clausingindustrial1">Follow on Instagram</a></div></div>     
    </div>          
    <style type="text/css">
        #mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId?> .mpinstagramfeed-photo {
            width: calc(<?= /** @noEscape */ $width ?> - 4px);
        }
        .mpinstagramfeed-container .mpinstagramfeed-photo .mpinstagramfeed-post-caption {
            font-size: <?= /** @noEscape */ $sizeIcon ?>;
        }

        @media (max-width: 767px) {
            .mpinstagramfeed-container #mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?> .mpinstagramfeed-photo {
                width: 48%;
            }
            .mpinstagramfeed-container #mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?> .mpinstagramfeed-photo.shuffle-item {
                width: auto;
            }
        }
        @media (min-width: 767px) and (max-width: 1024px) {
            .mpinstagramfeed-container #mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?> .mpinstagramfeed-photo {
                width: 30%;
            }
            .mpinstagramfeed-container #mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?> .mpinstagramfeed-photo.shuffle-item {
                width: auto;
            }
        }
    </style>
    <script type="text/x-magento-init">
    {
        "#mpinstagramfeed-photos-<?= /** @noEscape */ $widgetId ?>": {
            "mageplaza/instagram": {
                "id": "<?= /** @noEscape */ $widgetId ?>",
                "token": "<?= /** @noEscape */ $block->getAccessToken() ?>",
                "count": "<?= /** @noEscape */ $total ?>",
                "layout": "<?= /** @noEscape */ $options('layout') ?>",
                "show_caption": "<?= /** @noEscape */ $options('show_caption') ?>",
                "show_popup": "<?= /** @noEscape */ $options('show_popup') ?>"
            }
        }
    }
    </script>
    <script>
        require(('jquery', 'jquery/ui'), function($){ 
            //your js code here  
            $(function () {
                $("mpinstagramfeed-photo").slice(0, 3).show();
                $("#loadMore").on('click', function (e) {
                    e.preventDefault();
                    $("mpinstagramfeed-photo:hidden").slice(0, 4).slideDown();
                    if ($("mpinstagramfeed-photo:hidden").length == 0) {
                        $("#load").fadeOut('slow');
                    }
                    $('html,body').animate({
                        scrollTop: $(this).offset().top
                    }, 1500);
                });
            });         
        });
    </script>
<?php endif; ?>

Here is Instagram.js it is extensions default JS,

/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_InstagramFeed
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */
define((
    "jquery",
    "Mageplaza_InstagramFeed/js/lib/shuffle.min",
    "Mageplaza_InstagramFeed/js/lib/imagesloaded.pkgd.min",
    "mageplaza/core/jquery/popup"
), function ($, Shuffle) {
    "use strict";
    $.widget("mageplaza.instagram", {
        options: {
            id: "",
            token: "",
            count: "",
            sort: "",
            image_resolution: "",
            layout: "",
            show_like_comment: 0,
            show_popup: 0
        },
        _create: function () {
            this._ajaxSubmit();
        },

        showPopup: function (id) {
            $(id).magnificPopup({
                delegate: ".mpinstagramfeed-photo a",
                type: "image",
                gallery: {enabled: true},
                closeOnContentClick: true,
                closeBtnInside: false,
                fixedContentPos: true,
                mainClass: "mfp-no-margins mfp-with-zoom", // class to remove default margin from left and right side
                image: {
                    verticalFit: true
                },
                zoom: {
                    enabled: true,
                    duration: 300 // don't forget to change the duration also in CSS
                }
            });
        },

        _ajaxSubmit: function () {
            var self = this,
                id = "#mpinstagramfeed-photos-" + this.options.id,
                captionHtml = this.options.show_caption === '1' ? '<div class="mpinstagramfeed-post-caption">{{caption}}</div>' : '',
                photo_Template = '<div class="mpinstagramfeed-photo">' +
                '<a class="mpinstagramfeed-post-url " href="{{link}}" target="_blank">' +
                    captionHtml +
                '<img class="mpinstagramfeed-image" src="https://magento.stackexchange.com/{{imgSrc}}" alt="">' +
                '</a></div>';
            $.ajax({
                url: "https://graph.instagram.com/me/media",
                data: {
                    access_token: this.options.token,
                    fields: 'id, caption, media_type, media_url, permalink'
                },
                dataType: "json",
                type: "GET",
                success: function (data) {
                    var Image_url, item_Link,
                        items = data.data,
                        count = self.options.count;
                    $.each(items, function (index, item) {
                        if (index > parseInt(count)) {
                            return false;
                        }
                        if (item.media_type === 'VIDEO') {
                            return;
                        }

                        Image_url = item.media_url;
                        if (self.options.show_popup === "1") {
                            item_Link = Image_url;
                        } else {
                            item_Link = item.permalink;
                        }

                        var photo_Temp = photo_Template
                        .replace("{{link}}", item_Link)
                        .replace("{{caption}}", item.caption)
                        .replace("https://magento.stackexchange.com/{{imgSrc}}", Image_url);

                        $(id).append(photo_Temp);
                    });

                    for (var x in items) {
                        var item = data.data(x);

                    }
                },
                complete: function (data) {
                    // use shuffle after load images
                    if (self.options.layout === "optimized") {
                        self.demo(id);
                    }
                    if (self.options.show_popup === "1") {
                        self.showPopup(id);
                    }
                },
                error: function (data) {
                    console.log(data);
                }
            });
        },

        demo: function (id) {
            var element = document.querySelector(id);
            $(element).imagesLoaded().done(function (instance) {
                this.shuffle = new Shuffle(element, {
                    itemSelector: '.mpinstagramfeed-photo'
                });
            });
        }
    });

    return $.mageplaza.instagram;
});

Please help me to how to set Load More.. Images when we click on button,
or im doing something wrong code in JQuery?

What's The Equivalent Of Click Bait In The Real World?

Hello friends,

What’s the equivalent of click bait in the real world?

images click popup form and submit images captions in email to admin?

Create Custom Post gallery..archive page display images.
customer can click Enquiry Now button.. this button popup form submit all detalies name,email,phone no,msg to send email to admin

javascript – Track visitors across different domains using Google Analytics even when they don’t click between the sites

Apparently there are ways to track visitors across different domain using google analytics as described in documentation here and here.

It follows the principle where a visitor click on a link on website1.com and get redirects to website2.com with some additional path params which helps GA track if the visitor is same and GA maintain it’s session.

I have been looking around a lot and couldn’t find a solution on how can I track a visitor which comes on website1.com through ads and then leaves (And/Or open new tab) and immediately/later goes on to website2.com and make some purchase. I am not targeting to maintain session per user but at least I need to know if it’s the same visitor which goes there and converts.

I definately have access to both sites and can put GA tags and javaScripts on both websites.

macos – Chrome: when opening Youtube links, the video pauses after 1 sec, have to click play to continue

When I click a Youtube link in Chrome, it opens a tab with that particular Youtube link and starts playing.

However, for some strange reason, after playing for about 1 second it pauses the video. I have to click ‘play’ to continue.

For example, I visit youtube.com and click any of the suggested videos. It will open the page for that video and start playing automatically – for one second. Then it pauses.

Things I have already tried:

  • updated Chrome (already using latest version)
  • used Youtube with or without being logged in to Google
  • removed all add-ons and extensions
  • emptied cache, history, cookies, local storage, everything
  • closed and restarted Chrome, with all add-ons and extensions and cookies and history removed
  • rebooted my entire machine

All to no avail. I also tested in other browsers and it doesn’t happen in Brave or Firefox or Safari or Vivaldi, only in Chrome.

What could possible cause this?

P.S. FYI I’m using macOS 10.15.4 Catalina (with all latest updates)

What makes good click bait?

Hello friends,

What makes good click bait?

reactjs – style react component on click

so i have this simple divs of names:

divs here

i just want to press on one of them and get a background color of green and when pressing on another one the first one will be canceled so just one will be colored at a time. what i simply need is inline style or i don’t know i’m stuck.

first.js:

import React from ‘react’;

function SidebarComponents({name,title,selected,onSelect}) {

    const style={
        cursor: "pointer"
    };

    const classes = {
        selected: {
          backgroundColor: '#00ff00'
        }
      }

    return (
        <div 
            name={name}
            title = {title}
            style={style}
        >
           {name}
        </div>
    )

}
export default SidebarComponents;

second.js:

import React, { useEffect, useState } from "react";
import SidebarComponents from "../SidebarComponents/SidebarComponents";
import 'bootstrap/dist/css/bootstrap.min.css';
import '../Sidebar1/Sidebar.css';

function Sidebar({ onChange }) {
  const (selectedComponent, setSelectedComponent) = useState({
    componentsName: (
      { name: "John Smith", title: "John Smith" },
      { name: "Male, 26 years old", title: "Gender and age" },
      { name: "john", title: "Alerts" },
      { name: "claude", title: "Recent" },
      { name: "edward", title: "Blood pressure" },
      { name: "mira", title: "Body weight" },
      { name: "alex", title: "Glucose" },
      { name: "zac", title: "SPO2" }
    )
  });

  return (
    <div>
      {selectedComponent.componentsName.map(component => {
        return (
            <div className="row align-items-start sidebar-components">
                <div className="col">
                    <SidebarComponents 
                    name={component.name} 
                    title={component.title} 
                    />
                </div>
          </div>
        );
      })}
    </div>
  );
}

export default Sidebar;

Which online sites use the most click bait content?

Hello friends,

Which online sites use the most click bait content?