I wonder why this minus (-) on one place is able to hide the content while the others unable to hide the content, like nothing happen. It has the same codes. You can check the button simulation in : on the right top corner of the articles.

apages.blade.php

@extends('home')

...

<a class="plus-minus-toggeler"><span class="glyphicon glyphicon-minus"></span></a>
            <div class="backend-box _grey backend-box-email">

articles.blade.php

@extends('home')

...

<a class="plus-minus-toggeler"><span class="glyphicon glyphicon-minus"></span></a>
            <div class="backend-box _grey backend-box-email">

This is part of the home blade in laravel.

home.blade.php

 if (type == "article") {
        $('.placeholder-second').hide();
        $('.placeholder-first').hide();
        $(".backend-box").hide();
        $(".content-gallery ").hide();
        $("#artikel_placeholder").show();
        $(".placeholder-third").hide();
        $(".plus-minus-toggeler:not(.dont-hide)").hide();
    }

Any clue how to make the minus button works in apages.blade.php works? Like what js codes do I need to add?

Dani AI

Generated

Quick summary and the most likely fixes (based on the snippets and ' test): the broken control is usually caused by either (a) a selector/typo bug, (b) the handler being bound before the element exists (or the element is injected later), or (c) the click being absorbed/blocked by another element or CSS. Verify each of those in this order.

Use delegated event binding and target only the related box instead of hiding all boxes. This avoids timing issues and prevents one handler from affecting every instance:

// delegate in case togglers are added after DOM ready
$(document).on('click', '.plus-minus-toggeler', function(e){
  e.preventDefault();
  var $btn = $(this);
  // prefer immediate sibling, fall back to nearest container search
  var $box = $btn.next('.backend-box');
  if (!$box.length) $box = $btn.closest('.panel, .row, .backend-item').find('.backend-box').first();
  $box.toggle();
  $btn.find('.glyphicon').toggleClass('glyphicon-minus glyphicon-plus');
});

Troubleshooting checklist:

  • Confirm the class name is spelled exactly the same on the non-working button (watch for typos). Class selectors must start with a dot when used in jQuery (e.g., $('.foo')).
  • Put a console.log or a breakpoint inside the handler to see if the click fires on the problem button. If it never fires, the click is being intercepted or the element was created after your original binding.
  • Inspect the element in devtools: check computed z-index, pointer-events, and if an overlay/transparent element sits above the button. Also check for unclosed HTML tags that can alter DOM nesting.
  • Search project JS for any code that hides togglers or backend boxes under certain conditions; a global .hide() or a conditional branch can silently hide one instance (the admin/login flow can change DOM or run extra scripts).

If the toggler is generated via AJAX/template after page load, the delegated example above will fix it. If the issue persists after these checks, include the exact HTML around the non-working toggler (the button and its immediate parent/container) so the selector logic can be tailored precisely.

Recommended Answers

All 5 Replies

Which browser are you using? Both buttons appear to work fine in Chrome and Firefox.

Here cek this out:

You have to login to the admin page first:

login: davy_yg@yahoo.com
pass: 12345

Click the first arrow to go to page, then the second arrow to try to minimize the page layer.

- I PM the new password. Since someone changed my first password and makes me cannot login.

Since someone changed my first password and makes me cannot login.

Yeah, you could wait for that :))))

Oh... and it was not me!

I wonder why it doesn't work. I already add this script to hide the backend-box whenever the - (minus) sign being clicked.

 $('plus-minus-toggeler').on( "click", function( event ) {
    $('backend-box').hide();
});
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.