Issue with onhidden event not being triggered in Semantic UI library sidebar

Currently, I am utilizing semantic ui and struggling with attaching the callback function onHidden. Unfortunately, despite my efforts, the code snippet provided below does not seem to be functioning as expected; the callback is never triggered.

How can I resolve this issue?

$('.sidebar').sidebar('setting', 'onHidden', function(){
     console.log('on hidden');
});

Answer №1

Follow these steps:

$('.sidebar')
    .sidebar({
      onHide: function() {
        console.log('on hidden');
      }
  });
  

The correct syntax is as follows:

$('.your.element')
    .sidebar('behavior name', argumentOne, argumentTwo);
  

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unraveling the complexities of double-encoded UTF-8 in PHP

Trying to transmit data from an HTML page via Ajax to a PHP page. This is the jQuery code I'm using: $.ajax({ url: "test.php", type: "POST", data: { name: "João" } }).done(function (data) { alert(data); }) When sending ...

Switching Languages in react-simple-keyboard: Explained

import React, { useRef, useState } from "react"; import Keyboard from "react-simple-keyboard"; import "react-simple-keyboard/build/css/index.css"; function App() { const [input, setInput] = useState(""); const [ ...

"Discover the step-by-step process of transforming an input field value into a checkbox with

I've been experimenting with creating a To-Do list using HTML, CSS, and Javascript. I've managed to capture the input field value in a fieldset so far. However, my goal is to find a way to transform the input field value from the textfield into a ...

What are some ways to display alternative content when JavaScript is not enabled?

When JavaScript is disabled, I want to display an entirely different set of content. While I am aware that the <noscript> tag can be used for this purpose, how can I ensure that the remaining page elements are hidden as well? Any suggestions would b ...

Applying a filter within an ng-repeat loop to act as a conditional

Is it possible to use the ng-repeat as a conditional in an efficient and optimal way? I am wondering if there is a way for code to be shown only if found selected is true, without having to create a new variable in the back-end. <div ng-repeat="c ...

Using Immutable JS to Generate an OrderedMap from a List

I possess a List const results = [94, 88, 121, 17]; and I also own a Map const posts = { 94: { title: 'Foo bar', content: 'Blah blah blah...' }, 88: { title: 'Bar Foo', content: 'Blah blah blah...' }, 121 ...

Deleting an item from a JSON object

After searching Google and this site, I still couldn't find the solution I was looking for. Here is a JSON object I have: $scope.jsonObject = { "Card":{ "type":"menu", "options":["option1","option2"], "name":"With ca ...

405 error: NGINX blocking POST method in Django DRF Vue.js application

I have encountered a strange issue while building my ecommerce site. Everything seems to be working fine, except for the forms. When attempting to post content, I keep receiving a 405 method get not allowed error. It's confusing as I am trying to use ...

Splitting HTML elements with AngularJS Ng-repeat separators/dividers

I am brand new to Angular and have a list item filled with some data: <li ng-repeat="content in contents"> <a class="item" href="#"> <p><strong>{{content.Company}}</strong></p> <p>{{content.Town}}, ...

Having trouble with Node.js Async/Await not returning as anticipated

Attempting to create a basic report server using node express, but encountering unexpected issues. Below is the API endpoint for generating a report: router.post('/test', async function (req, res) { return res.json(await reportService.test()); ...

Steps to create a dropdown select option using an AJAX call: When the data is fetched, it generates an array

How can I dynamically populate a dropdown with data from an array using jQuery and AJAX? <html> <script> $(document).ready(function() { $("#class_name").change(function(){ var class_id=$("#class_name").val(); ...

Enhancing JavaScript Arrays by incorporating data from a JSON file

Could you kindly advise me on what I might be doing incorrectly here? It seems like a simple issue, but it has taken up the entire day. All I wanted to do was add a value to an array called messages from a JSON file. function get_message(params) { va ...

Disable the button until all input fields contain text in ASP

Curious if anyone knows how to disable a button until all text boxes have input in ASP.NET and C#. Here is an image showing the scenario I'm referring to - wanting to gray out the commit button. Thanks, Chris! ...

What is the process for inserting an "inline image" in a form prior to uploading it?

I am looking to implement a feature that allows users to write a post and seamlessly upload images within the content, similar to a CMS blog post. Writing the file upload script is straightforward, but creating functionality for an "inline" image placement ...

Executing a function on a dropdown menu in AngularJS

Currently facing an intriguing scenario that is causing me some confusion. This question is specifically for those well-versed in Angular UI Grid, but all responses are welcome. The situation revolves around a UI Grid with a dropdown functionality impleme ...

Transmitting a key-value pair data object to the server-side code-behind aspect

Transferring a key value pair object to the server side codebehind. What is the method to send it from JavaScript? And how can it be received in C# codebehind? Modification 1 <script type="text/javascript"> function ABC() { va ...

Using JavaScript regex to match repeating subgroups

Can a regular expression capture all repeating and matching subgroups in one call? Consider a string like this: {{token id=foo1 class=foo2 attr1=foo3}} Where the number of attributes (e.g. id, class, attr1) are variable and can be any key=value pair. C ...

Slick carousel not functioning properly with Angular slickGoTo

I am currently working with the angular-slick-carousel library. Unfortunately, I am encountering an issue where the Slick methods, such as slickGoTo(), are not functioning as expected. Below is my Controller setup following the provided documentation: $s ...

Tips for preventing double foreach loops in Laravel when dealing with backward relationships

I'm attempting to display variables using the following relationships: First: public function group(){ return $this->belongsTo(Group::class); } Second: public function joinGroups(){ return $this->hasMany(JoinGr ...

An issue occurred during the AJAX request to the ASP MVC Action Controller

When clicking on a button, an AJAX request is triggered to send an ID to the controller. The server-side code runs without any errors, but within the controller action there is a section using RestSharp that makes requests to a REST web service. This part ...