HEX
Server: Apache/2
System: Linux ns65.hostinglotus.net 4.18.0-553.16.1.el8_10.x86_64 #1 SMP Thu Aug 8 07:11:46 EDT 2024 x86_64
User: newsnnno (1225)
PHP: 8.2.20
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/newsnnno/public_html/khaodeedee/blog/wp-content/themes/newscrunch/assets/js/main.js
(function($){
  
    $(document).ready(function() {
    
        // Fullwidth Serach Box
        $(function(){
            var $searchlink = $('#search_toggle_fullwidth');
            var $searchbar_fullwidth  = $('#searchbar_fullwidth');
          
            $('#search_toggle_fullwidth').on('click', function(e){
              e.preventDefault();
                if($(this).attr('id') == 'search_toggle_fullwidth') {
                    if(!$searchbar_fullwidth.is(":visible")) { 
                        // if invisible we switch the icon to appear collapsable
                        $searchlink.removeClass('fa-search').addClass('fa-search-minus');
                    } else {
                        // if visible we switch the icon to appear as a toggle
                        $searchlink.removeClass('fa-search-minus').addClass('fa-search');
                    }
                    $searchbar_fullwidth.slideToggle(300, function(){
                    // callback after search bar animation
                    });
                }
            });
          
          $('#searchform_fullwidth').submit(function(e){
              e.preventDefault(); // stop form submission
          });
        });


        // Fullscreen Serach Box 
        $(function() {      
            $('a[href="#searchbar_fullscreen"]').on("click", function(event) {    
                event.preventDefault();
                $("#searchbar_fullscreen").addClass("open");
                $('#searchbar_fullscreen > form > input[type="search"]').focus();
            });

            $("#searchbar_fullscreen, #searchbar_fullscreen button.close").on("click", function(event) {
                if (
                  event.target == this ||
                  event.target.className == "close" ||
                  event.keyCode == 27
                ) {
                    $(this).removeClass("open");
                }
            });
 
        });

    });
})(jQuery);