Senza categoria

Cookie & Privacy Policy

<a class="iubenda-white no-brand iubenda-embed iub-body-embed" title="Privacy Policy" href="https://www.iubenda.com/privacy-policy/30241026">Privacy Policy</a>

<script type="text/javascript">// <![CDATA[
(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);
// ]]></script>


<a class="iubenda-white no-brand iubenda-embed iub-body-embed" title="Cookie Policy" href="https://www.iubenda.com/privacy-policy/891167/cookie-policy">Cookie Policy</a>

<script type="text/javascript">// <![CDATA[
(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);
// ]]></script>

<a href="/privacy-policy/" alt="Privacy Policy" title="Privacy Policy">Privacy Policy</a> | <a href="/cookie-policy/" alt="Cookie Policy" title="Cookie Policy">Cookie Policy</a>
javascript, jQuery

SquareSpace Scroll + YouTube PopUP

<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>

<script type="text/javascript">
	$(document).ready(function() { 
    
    $('a[href*="https://www.youtube.com/watch?"]').each(function() {
  $(this).attr('data-fancybox','');
 });
      
   $('a[href*="https://youtu.be/"]').each(function() {
  $(this).attr('data-fancybox','');
 });    
	
	
	});
</script>

<script>
$(document).ready(function(){
  // Add smooth scrolling to all links
  $("a").on('click', function(event) {

    // Make sure this.hash has a value before overriding default behavior
    if (this.hash !== "") {
      // Prevent default anchor click behavior
      event.preventDefault();

      // Store hash
      var hash = this.hash;

      // Using jQuery's animate() method to add smooth page scroll
      // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
      $('html, body').animate({
        scrollTop: $(hash).offset().top
      }, 800, function(){
   
        // Add hash (#) to URL when done scrolling (default click behavior)
        window.location.hash = hash;
      });
    } // End if
  });
});
</script>

Aggiungendo il codice in tutte le pagine non ci sono problemi

il clic si attiva su ID dell’elemento sia un <p> o un <div>

 

Senza categoria

SquareSpace Scroll

va inserito dentro la pagina specifica

<script src="https://code.jquery.com/jquery-2.1.3.min.js">
</script><script type="text/javascript">
$(function() {$('a[href*=#]:not([href=#])').click(function() {if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {var target = $(this.hash);target = target.length ? target : $('[name=' + this.hash.slice(1) +']');if (target.length) {$('html,body').animate({scrollTop: target.offset().top}, 1000);return false;}}});});
</script>

si aggiunge un nuovo blocco di codice

<a name="special"></a>

 

PHP, WordPress

Plugin Cart Flatsome

file woocommerce-cart-add-ons.php

cercare la linea <ul class=”products sfn-cart-addons”>

<ul class="products sfn-cart-addons row large-columns-4 medium-columns-3 small-columns-1 row-small">

 

AGGIUNGI AL FILE woocommerce-cart-add-ons.php (riga 71 circa)

//checkout page
add_action('woocommerce_after_checkout_form', array($this, 'cart_display_addons'), 20);

 

javascript

mobile da javascript

<script>
jQuery( document ).ready(function($) {      
    var isMobile = window.matchMedia("only screen and (max-width: 760px)").matches;

    if (isMobile) {
        //Conditional script here

    } 
 });

</script>