1

卡片内的按钮无响应。我的目标是在单击每张卡片的按钮时显示和隐藏小时。我添加了 Javascript 来处理这个函数,但它似乎没有响应。当我在标签之外创建一个按钮时,按钮似乎功能正常并且脚本运行良好。任何和所有的见解都会非常感谢我缺少什么,因为我已经尝试了几乎所有我拥有的以下内容:

<style>
    .form-section {
        width: 321px;
        flex-wrap: wrap;
    }
</style>
<script type="text/javascript">
     $(document).ready(function() {

     $(".lebron").click(function () {
     $(".hi").hide();
     });
    $(".james").click(function () {
     $(".hi").show();
     });
    $(".k").click(function () {
     $(".hi").show();
     });
});



</script>
<script>

    $scope.showHours = function(){
    $('.hi').hide();
    };
</script>

<link href="//@System.Configuration.ConfigurationManager.AppSettings["CDNBase"]/Content/themes/OpenCart/stylesheet.min.css" rel="stylesheet" /> <!--@@sk updated at 06/03/2018-->
<link href="//@System.Configuration.ConfigurationManager.AppSettings["CDNBase"]/Content/themes/OpenCart/typo.min.css" rel="stylesheet" />@*sk updated at 06/03/2018*@


<div class="container" style="background-color:blue;" ng-controller="StoreController" ng-cloak>

    <img src="../images/StoreLocations/locationsPageBanner.jpg" style="padding-bottom: 25px">


    <div class='md-padding' layout="row" layout-wrap style="">

        <md-content class="md-padding" layout="row" layout-wrap ng-repeat="store in lstStores.data" style="background-color:pink;">

            <md-card class="form-section">



                <md-card-header style="background-color: dodgerblue; font-size:21px; color: white">
                    <md-card-header-text>
                        <md-card-header-text class="md-title" ng-bind="store.storeDisplayLink | uppercase"></md-card-header-text>
                        <md-card-header-text class="md-subhead" , style="color: lightgrey"> <span ng-bind="store.StoreCity"> city,state </span></md-card-header-text>
                    </md-card-header-text>
                </md-card-header>


                <md-card-content>
                    <div>
                        <p>
                            <ng-bind-html ng-bind-html="store.StoreAddress"></ng-bind-html>
                        </p>
                        <p>
                            @*<a target="_self" ng-href="/Location/store/{{store.storeId}}">Get Map</a><br />*@

                            <span ng-if="isMobile == true"><a href="tel:{{store.storeMainPhone | EliminateSpaces}}"> {{store.storeMainPhone | uppercase}} </a></span> <span ng-if="isMobile == false">{{store.storeMainPhone | uppercase}}</span>
                            <br />
                            <br />


                            <button class="hours" style="width:110px" ng-click="showHours()">
                                Store Hours
                            </button>

                            <div class="Hours">
                                <ng-bind-html ng-bind-html="store.StoreHours"></ng-bind-html>
                            </div>

                            <br />
                            <a target="_self" ng-href="/{{store.storeDisplayUrl}}" style="font-weight: 700;color: black;text-decoration: none;font-size: 16px;">Get Map</a>
                            <a href="/Location/Index" target="_self" class="location-icon-333 "></a>
                        </p>
                    </div>
                </md-card-content>


            </md-card>
        </md-content>
    </div>

</div>
4

0 回答 0