$(function(){
$('#nav li').on('click', function(){
//$(this).addClass('active').removeClass('off').siblings().addClass('off').removeClass('active'); // no need to add .off
$(this).addClass('active').siblings().removeClass('active');
});
});
Author: rajumdhaka
Click to show section
<script>
document.addEventListener('DOMContentLoaded', function() {
jQuery(function($){
$('.clicktoshow').each(function(i){
$(this).click(function(){ $('.showclick').eq(i).show();
$('.clicktoshow').eq(i).hide();
}); });
}); });
</script>
<style>
.clicktoshow{
cursor: pointer;
}
.showclick{
display: none;
}
</style>
Eelementor Accordion close by default
<script>
jQuery(document).ready(function($) {
var delay = 100; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none'); }, delay);
});
</script>
OR
<script>
jQuery(window).on('load', function () {
jQuery('.elementor-tab-title').removeClass('elementor-active');
jQuery('.elementor-tab-content').css('display', 'none');
});
</script>
Hide Dashboard and Elementor for Subscribers
//Hide Dashboard and Elementor for Subscribers
function remove_menus() {
if( current_user_can('client') && is_admin()) {
remove_menu_page( 'index.php' ); //Dashboard
remove_menu_page( 'edit.php?post_type=elementor_library' ); //Elementor Templates
}
}
add_action( 'admin_menu', 'remove_menus' );
jQuery add sticky class on scroll
$(window).scroll(function() {
if ($(this).scrollTop() > 575){
$('.side-banner-sticky').addClass("content_fixed");
}
else{
$('.side-banner-sticky').removeClass("content_fixed");
}
});
jQuery set dynamic image height
jQuery(document).ready(function( $ ){
var heightc = $(".top-ads-banner img").height();
$(".top-ads-banner").height(heightc);
});
CSS
.top-ads-banner {
position: sticky;
top: 0;
-webkit-transition: all 1.5s;
-moz-transition: all 1.5s;
-ms-transition: all 1.5s;
-o-transition: all 1.5s;
transition: all 1.5s;
width: 100%;
margin: 0 auto;
background: #000;
height: 0px;
}
Adobe photoshop Mac
Open terminal, paste the code.
sudo spctl --master-disable
Disable the internet and install the file.
Elementor Age gate verification
document.getElementById("dateofbirthsubmit").addEventListener('click',function ()
{
var dateString = document.getElementById('form-field-dateofbirth').value;
if(dateString !=='')
{
var today = new Date();
var birthDate = new Date(dateString);
var age = today.getFullYear() - birthDate.getFullYear();
if(age < 18 || age > Infinity)
{
elementorProFrontend.modules.popup.showPopup( {id:50}, event);
event.preventDefault();
}
}
else
{
alert("You must provide your date of birth!");
}
} );
Load textdomain
function wordcount_load_plugin_textdoamin(){
load_plugin_textdomain("word-count", false, dirname(__FILE__)."/languages");
}
add_action("plugins_loaded", "wordcount_load_plugin_textdoamin");
Plugin Activation / Deactivation hook
function wordcount_activaton_hook(){
}
register_activation_hook(__FILE__, 'wordcount_activaton_hook');
function wordcount_deactivaton_hook(){
}
register_deactivation_hook(__FILE__, 'wordcount_deactivaton_hook');