我怎樣才能像的風格標題所以它顯示的標題是這樣的:http://s28.postimg.org/qd6ic020d/hover.png 感謝每一個答案如果我有我的鼠標在圖像上顯示它的文本
-1
A
回答
0
這些被稱爲提示。 你可以查找很多這些類型的插件。
例如
- http://foundation.zurb.com/docs/components/tooltips.html
- http://www.w3schools.com/bootstrap/bootstrap_tooltip.asp
- 和許多許多!
谷歌是你的朋友在這裏。
許多需要JS,但有可能只是通過CSS來做到這一點:
例如
0
你可以試試這個
HTML
<a href="#" title="Hello world!">Hello</a>
CSS
a {
color: #900;
text-decoration: none;
}
a:hover {
color: red;
position: relative;
}
a[title]:hover:after {
content: attr(title);
padding: 4px 8px;
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
z-index: 20px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}
0
您可以使用popover
從bootstrap
這裏是如何
$(document).ready(function() {
$('[data-toggle="popover"]').popover({
trigger: "hover"
});
});
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<div class="container">
<h3>Popover Example</h3>
<a href="#" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover">hover here. Toggle popover</a>
</div>
更新:您可以定位popover
當這樣懸停時
//Top
<a href="#" title="Header" data-toggle="popover" data-placement="top" data-content="Content">Click</a>
//bottom
<a href="#" title="Header" data-toggle="popover" data-placement="bottom" data-content="Content">Click</a>
//left
<a href="#" title="Header" data-toggle="popover" data-placement="left" data-content="Content">Click</a>
//right
<a href="#" title="Header" data-toggle="popover" data-placement="right" data-content="Content">Click</a>
相關問題
- 1. 如何在懸停我的鼠標的圖像上顯示懸停效果
- 2. 我想在JavaScript中將鼠標移到圖像上時顯示文本
- 3. JS如果圖像存在,顯示它。否則,顯示文本
- 4. 將鼠標懸停在文本上時顯示圖像
- 5. 在鼠標上顯示圖像
- 6. 如果圖像不存在,我必須在圖像的位置顯示文本
- 7. 我的圖像根本沒有顯示
- 8. 鼠標懸停在LibreOffice中的文本時顯示圖像
- 9. 使用javascript在鼠標上的圖像頂部顯示文字
- 10. Android - 我如何顯示我的圖像基本標準材料?
- 11. 在縮略圖上顯示鼠標上的鏈接圖像
- 12. 我可以在Android的圖像圖標上顯示文本框編輯器嗎?
- 13. 圖像懸停 - 鼠標顯示爲文本圖標?
- 14. PHP上的圖像文件不顯示我上傳的圖像
- 15. 當鼠標懸停在圖像上時,在圖像上顯示文字
- 16. 使用Ajax在圖像上的鼠標懸停後顯示文本
- 17. jQuery將鼠標懸停在文本上以顯示淡入淡出的圖像
- 18. 如何顯示在鼠標上彈出的文本在php
- 19. 如何顯示一個簡單的文本框,當我將鼠標懸停在使用jquery的圖標上
- 20. 在鼠標上的圖像地圖顯示div
- 21. 在HTML中,如何以全新的形象將基本影像,當我翻滾我的鼠標我的基本圖像,使得兩個圖像並排顯示
- 22. 將鼠標懸停在另一圖像上時顯示圖像
- 23. 鼠標移到文本 - 圖像顯示在固定位置
- 24. 如何獲取元素的文本,當鼠標移到它它顯示文本
- 25. 鼠標懸停在圖像上時可點擊圖標顯示
- 26. 如何顯示鼠標附近的圖像上的排
- 27. 將鼠標懸停在圖像上時顯示文字
- 28. 鼠標懸停的圖像模糊圖像和顯示文字
- 29. 圖像沒有顯示在我的UICollectionView
- 30. 在鼠標上的圖像
這不是圖像。它的工具提示。谷歌它,你會發現很多的例子 – vbouk
檢查我的答案。彈出'bootstrap彈出窗口'時出現 – Alex