File: /home/kashmira/public_html/razitahir.com/wp-content/plugins/upress-widgets/assets/js/panel.js
jQuery(document).ready(function($){
    var value = $("#cbToolSharing").val();
    //alert(value);
    $("#cbToolSharing").click(function(){
        $("#socilSubControls").toggle();
    });
});
function toggle_position_fields(){
    var position = jQuery("#cbToolsSharingPosition").val();
    if(position == 1) {
        jQuery("#floatingPositionControls").show();
        jQuery("#contentPositionControls").hide();
    }
    if(position == 2) {
        jQuery("#floatingPositionControls").hide();
        jQuery("#contentPositionControls").show();
    }
}
jQuery(document).ready(function($) {
    // AJAX function to fetch and display posts
    function fetchPosts() {
        $.ajax({
            url: 'https://stylothemes.com/wp-json/wp/v2/posts?per_page=5', // Add the per_page parameter
            type: 'GET',
            dataType: 'json',
            success: function(response) {
                // Handle the response and display the posts
                if (response.length > 0) {
                    // Clear previous posts
                    $('#stylo-updates-restapi').empty();
                    // Loop through the posts and display them
                    $.each(response, function(index, post) {
                        var postHTML = '<h2><a href="' + post.link + '" target="_blank">' + post.title.rendered + '</a></h2>';
                        $('#stylo-updates-restapi').append(postHTML);
                    });
                } else {
                    $('#stylo-updates-restapi').html('No posts found.');
                }
            },
            error: function(xhr, status, error) {
                console.log(error);
            }
        });
    }
    // Call the fetchPosts function on page load
    fetchPosts();
});