簡體   English   中英

引導輪播標題按鈕不可點擊

[英]Bootstrap carousel caption buttons are not clickable

我用引導輪播構建了一個頁面,該頁面有段落標題和兩個按鈕,按鈕沒有顯示為可點擊,點擊時沒有任何反應。

 {% block body %} <div id ="car-container"> <div class="container-fluid" style= "padding-right: 0px; padding-left: 0px;"> <div id="carousel-home" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div id = "carousel-inner"> <div class="carousel-item active"> <div class = "overlay-background"> <div class="overlay"> <img class="d-block w-100 carousel-home-img" src="empImg1.jpg" alt="First slide"> </div> </div> <div id = "cap_one" class="carousel-caption "> <div id = "cap-head"> <h5 id ="h5">The People Award</h5> </div> <p> We have been awarded 'The People Award' three years running due to our high levels of customer service.</p> <a href="{{ path('emp_services_lettings') }}" target="_blank" class="btn btn-primary btn-lg btn-md" role="button" style = "background-color: #2b459c;important: color: #FFFFFF;important">Find a property</a> <button type="button" class="btn btn-primary btn-lg btn-md" style = "background-color: #d39e00!important; color: #FFFFFF!important">Valuation</button> </div> </div>

為了使您的按鈕可點擊,您需要添加一個 onclick 事件,如下所示:

<button type="button" class="btn btn-primary btn-lg btn-md"
style="background-color:  #d39e00!important; color: #FFFFFF!important" 
onclick="testMe()">Valuation</button>

並在您的 javascript 中創建一個function testMe(){ code you want to execute when clicked }

至於你的href標簽,我不確定你使用什么變量來創建路徑,所以有點難以理解,但你可以像這樣放置路徑:

<a href="http://www.google.com" // and the rest of your code

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM