0

I have dynamically appended a div into another div called faculty-popup by using the appendTo in jQuery which is a pop-up however, the a link works on the original div but not on the one it was appended to.

<div class="c-tabs__tab js-tabs-tab o-wrapper faculty-popup" id="js-tab-faculty">
        <div class="u-pb-0">
                                        <h5 class="popup-title hideme">Faculty &amp; Disclosures</h5>
                    </div><!-- /.u-pb-global -->
                                    <div data-facultycard="true" class="faculty-card-wrap u-pb-5">
                    <div class="c-card faculty-card c-card--large c-card--flex-wrap s-standard-content">
                        <span class="c-card__details c-card__details-alt u-mb-4">
                                                            <div class="avatar-bio-wrap">
                                    <span class="o-avatar c-card__col">
                                        <img src="https://dev.touchneurology.com/wp-content/uploads/sites/3/2021/12/AdobeStock_369184018-scaled.jpeg" class="u-cover" alt="">
                                    </span><!-- /.o-avatar -->
                                                                        <span class="c-card__col c-card__col--name">
                                                                            <h6 class="h6 u-mb-2">Dr Joanna Van</h6>
                                                                                                                <p class="u-mb-0 c-card__sub-title">Diabetes Research Center, Tustin, CA, USA</p>
                                                                        </span>
                                </div>
                            <i class="fa-thin fa-arrow-right-long"></i>
                        </span>
                        <span class="c-card__col c-card__col--last hide c-card__disclosures">
                                                            <p>Dr Joanna Van is Principal Investigator at the Diabetes Research Center in Orange County, CA. She received her undergraduate degree from the University of California, San Diego, where she discovered a personal interest in research and diabetes medicine.<br>
Dr Van participated in numerous research publications while obtaining her medical degree from Western University of Health Sciences and Residency in Family Practice at Arrowhead Regional Medical Center. She has been a clinical research investigator for more than 11 years and has completed more than 130 clinical trials. She was voted as one of Orange County’s Physicians of Excellence by Orange Coast Magazine.<br>
Dr Van continues to be at the forefront of diabetes through her research, attendance, and presentations at various medical conferences. She admits that her job satisfaction comes primarily from her passion for her patients’ well-being and her personal commitment to providing quality medical research.<br>
Dr Joanna Van discloses: Grants/research support from Lilly, Eliem Therapeutics, Novo Nordisk, Pfizer, Sanofi and Lexicon</p>
                                                                                        <p class="u-mb-2">
                                    <!-- <strong>Disclosures:</strong> -->
                                    test disclosures
                                </p>
                                                    </span>
                    </div><!-- /.c-card -->
                </div><!-- /.u-pb-global -->
                            <div data-facultycard="true" class="faculty-card-wrap u-pb-0">
                    <div class="c-card faculty-card c-card--large c-card--flex-wrap s-standard-content">
                        <span class="c-card__details c-card__details-alt u-mb-4">
                                                            <div class="avatar-bio-wrap">
                                    <span class="o-avatar c-card__col">
                                        <img src="https://dev.touchneurology.com/wp-content/uploads/sites/3/2021/12/Kurtis-image.png" class="u-cover" alt="">
                                    </span><!-- /.o-avatar -->
                                                                        <span class="c-card__col c-card__col--name">
                                                                            <h6 class="h6 u-mb-2">Dr Vincent Woo</h6>
                                                                                                                <p class="u-mb-0 c-card__sub-title">University of Manitoba, Winnipeg, Manitoba, Canada</p>
                                                                        </span>
                                </div>
                            <i class="fa-thin fa-arrow-right-long"></i>
                        </span>
                        <span class="c-card__col c-card__col--last hide c-card__disclosures">
                                                            <p>Dr Vincent Woo obtained his medical degree from the University of Manitoba and his specialty training in Endocrinology and Metabolism at the University of British Columbia. He is currently a member of the Section of Endocrinology and Metabolism at the University of Manitoba.<br>
<a class="read-more-link" data-read-more-link="read more">read more</a></p>
<div>Dr Woo is actively involved with the Canadian Diabetes Association, where he is a past Chair of the Clinical and Scientific Section and served on the Board of Directors. He is a member of the Canadian Hypertension Guidelines and co-authored the Diabetes and Driving guidelines in Canada.<br>
Dr Woo chaired the 2008 Clinical Practice Guidelines for the Prevention and Management of Diabetes in Canada, and was also on the Executive and Steering committees for the 2013 and 2018 Clinical Practice Guides, co-authoring many of the chapters. He was awarded the Gerald S. Wong Award in 2014 for dedication to diabetes service in Canada and the 2014 Best Banting award for dedicated service in diabetes for the Province of Manitoba. He has received teaching awards from the University of Manitoba Medical School.<br>
Dr Woo is a principal investigator at the Diabetes Research Group at the John Buhler Research Centre and is involved in a large number of important clinical trials. He has published over 100 articles and abstracts, and is a reviewer and Associate Editor for several journals, including Diabetes Care.<br>
He is actively involved in teaching and continuing medical education at all levels, from medical students, residents and fellows to family physicians and endocrinologists.<br>
Dr Vincent Woo discloses: Consulting and Speakers bureau fees from AstraZeneca, Boehringer Ingelheim, Lilly and Novo Nordisk.</div>
                                                                                        <p class="u-mb-2">
                                    <!-- <strong>Disclosures:</strong> -->
                                    dsds dadas dasdasda<!--more-->
sadasdasd
                                </p>
                                                    </span>
                    </div><!-- /.c-card -->
                </div><!-- /.u-pb-global -->
                        </div>
                    $(".faculty-card").on("click", function() {  
                        const facultyWrapper  = $(this).parent().parent();
                        //console.log(facultyWrapper);
                        const h = $(this).clone().prependTo(facultyWrapper).wrap('<div class="popup-title faculty-full-bio">Faculty & Disclosures</div>');
                        $(".faculty-full-bio").parent().parent().css("display", "block");
                   
                        $(".faculty-card").parent().each(function(){
                           const j = $(this).data("facultycard");
                           if (j === true) {
                               $(this).hide();
                               $(".hideme").hide();
                               $(".fa-people-group").hide();
                               $(".back-to-faculty").css("position", "static");
                           } 
                             
                        });
                    });
raja
  • 25
  • 5

0 Answers0