Change + and - sign

Posted 7 months ago by davy_yg

recruitment.blade.php

    <!-- Heading End-->
            <div class="panel">
                <div class="list-group">
                    <div class="list-group-item">
                        <div id="open">
                        <div class="gray">
                        <div class="card-header">
                            <a class="btn btn-link" data-toggle="collapse" data-target="#collapse<?php echo $i ?>"> <?php echo $data['position'].'<br>'; ?></a>
                             
                            <span style="float: right;"><span class="fa fa-plus"></span></span>
                            <span style="float: right;"><span class="fa fa-minus"></span></span>                                    
                        </div>
                        </div>                        
                        </div><br>
                        <div class="expanded">
                        <div class="card-body" id="collapse<?php echo $i ?>">
                            <p><?php echo Lang::get('message.job-intro1');?></p>
                            <div class="job-desc">                                    
                                <?php echo $data['description']; ?> 
                            </div>
                            <div class="career-background">
                                <h3>Background</h3>
                                <?php echo $data['background']; ?>
                            </div>
                            <div class="competencies">
                                <h3>Kompetensi</h3>
                                <?php echo $data['qualification']; ?>
                            </div><br>
                            <button class="btn btn-primary" onclick=" location.href='{{ url("/form") }}'"> Apply </button><br>
                        </div>
                        </div>
                    </div>

            <?php $i++;  }   ?>          

                    
                    </div>                            
                </div>


    ....
    
    <script>

        $( ".btn btn-link" ).click(function(e) {

        if(!$('.btn btn-link').hasClass('expanded')) {

        $('.btn btn-link').addClass('expanded');
    
        $(".fa fa-plus").addClass("d-none");
        $(".fa fa-minus").removeClass("d-none");       
        $(".card-reader .fa fa-minus").hide();
        $(".card-reader fa fa-plus").show();  
  
        } else {

        $('.btn btn-link').removeClass('expanded');        
    
        $(".card-reader .fa fa-plus").removeClass("d-none");   
        $(".card-reader .fa fa-minus").addClass("d-none");          
        $(".card-reader .fa fa-minus");
        $(".card-reader fa fa-plus").hide();  
        }

        });

Please sign in or create an account to participate in this conversation.