diff --git a/bootstrap-1.0.0.css b/bootstrap-1.0.0.css index a902aaba6a..3046626e70 100644 --- a/bootstrap-1.0.0.css +++ b/bootstrap-1.0.0.css @@ -1593,3 +1593,63 @@ div.modal .modal-footer .btn { float: right; margin-left: 10px; } +div.twipsy { + display: block; + position: absolute; + visibility: visible; + padding: 5px; + font-size: 10px; + z-index: 100000; + filter: alpha(opacity=80); + -khtml-opacity: 0.8; + -moz-opacity: 0.8; + opacity: 0.8; +} +div.twipsy.above .twipsy-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000; +} +div.twipsy.left .twipsy-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000; +} +div.twipsy.below .twipsy-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000; +} +div.twipsy.right .twipsy-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000; +} +div.twipsy .twipsy-inner { + padding: 5px 8px 4px; + background-color: #000; + color: white; + text-align: center; + max-width: 200px; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +div.twipsy .twipsy-arrow { + position: absolute; + width: 0; + height: 0; +} diff --git a/bootstrap-1.0.0.min.css b/bootstrap-1.0.0.min.css index 8650c0f79b..e066d5ba60 100644 --- a/bootstrap-1.0.0.min.css +++ b/bootstrap-1.0.0.min.css @@ -197,3 +197,9 @@ div.modal{position:fixed;top:50%;left:50%;z-index:2000;width:560px;margin:-280px div.modal .modal-body{padding:20px;} div.modal .modal-footer{background-color:#eee;padding:14px 20px 15px;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;}div.modal .modal-footer:after{display:block;visibility:hidden;height:0;clear:both;content:".";} div.modal .modal-footer .btn{float:right;margin-left:10px;} +div.twipsy{display:block;position:absolute;visibility:visible;padding:5px;font-size:10px;z-index:100000;filter:alpha(opacity=80);-khtml-opacity:0.8;-moz-opacity:0.8;opacity:0.8;}div.twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000;} +div.twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000;} +div.twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000;} +div.twipsy.right .twipsy-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000;} +div.twipsy .twipsy-inner{padding:5px 8px 4px;background-color:#000;color:white;text-align:center;max-width:200px;text-decoration:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +div.twipsy .twipsy-arrow{position:absolute;width:0;height:0;} diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 8a74c2eb3c..8f54c99699 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -34,7 +34,7 @@ $(document).ready(function(){ $(this).parents('.add-on').removeClass('active'); } }); - + // Disable certain links in docs $('ul.tabs a, ul.pills a, .pagination a').click(function(e) { e.preventDefault(); @@ -84,4 +84,46 @@ $(document).ready(function(){ processScroll(); $window.scroll(processScroll); + + // POSITION TWIPSIES + // ================= + $('.twipsies.well a').each(function () { + var type = this.title + , $anchor = $(this) + , $twipsy = $('.twipsy.' + type) + + , twipsy = { + width: $twipsy.width() + 10 + , height: $twipsy.height() + 10 + } + + , anchor = { + position: $anchor.position() + , width: $anchor.width() + , height: $anchor.height() + } + + , offset = { + above: { + top: anchor.position.top - twipsy.height + , left: anchor.position.left + (anchor.width/2) - (twipsy.width/2) + } + , below: { + top: anchor.position.top + anchor.height + , left: anchor.position.left + (anchor.width/2) - (twipsy.width/2) + } + , left: { + top: anchor.position.top + (anchor.height/2) - (twipsy.height/2) + , left: anchor.position.left - twipsy.width - 5 + } + , right: { + top: anchor.position.top + (anchor.height/2) - (twipsy.height/2) + , left: anchor.position.left + anchor.width + 5 + } + } + + $twipsy.css(offset[type]) + + }); + }); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index d1b9241819..ea6bd178bd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -265,8 +265,10 @@
Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.
+You can also add subheadings with the <strong>
and <em>
Twipsies are super useful for aiding a confused user and pointing them in the right direction.
+