aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2011-07-01 22:16:29 -0700
committerMark Otto <[email protected]>2011-07-01 22:16:29 -0700
commit163e68ade6eb9e1a8a2e52aadf975612ab850579 (patch)
tree6071bb83bfb00173196f32e1f847e63537822691 /docs
parent7962b36dae6d0d793e2bfa04d69ae1a2e5dbd611 (diff)
parent26f9e8c4e8580c2d41f31a4fb504ee8c0fdeb145 (diff)
downloadbootstrap-163e68ade6eb9e1a8a2e52aadf975612ab850579.tar.xz
bootstrap-163e68ade6eb9e1a8a2e52aadf975612ab850579.zip
resolve merge conflict
Diffstat (limited to 'docs')
-rw-r--r--docs/assets/js/application.js121
-rw-r--r--docs/index.html35
2 files changed, 123 insertions, 33 deletions
diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js
index 4b377f704..82cf307e9 100644
--- a/docs/assets/js/application.js
+++ b/docs/assets/js/application.js
@@ -1,6 +1,47 @@
$(document).ready(function(){
- // Example dropdown for topbar nav
+ // scroll spy logic
+ // ================
+
+ var activeTarget,
+ $window = $(window),
+ position = {},
+ nav = $('body > .topbar li a'),
+ targets = nav.map(function () {
+ return $(this).attr('href');
+ }),
+ offsets = $.map(targets, function (id) {
+ return $(id).offset().top;
+ });
+
+
+ function setButton(id) {
+ nav.parent("li").removeClass('active');
+ $(nav[$.inArray(id, targets)]).parent("li").addClass('active');
+ }
+
+ function processScroll(e) {
+ var scrollTop = $window.scrollTop() + 10, i;
+ for (i = offsets.length; i--;) {
+ if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) {
+ activeTarget = targets[i];
+ setButton(activeTarget);
+ }
+ }
+ }
+
+ nav.click(function () {
+ processScroll();
+ });
+
+ processScroll();
+
+ $window.scroll(processScroll);
+
+
+ // Dropdown example for topbar nav
+ // ===============================
+
$("body").bind("click", function(e) {
$("ul.menu-dropdown").hide();
$('a.menu').parent("li").removeClass("open").children("ul.menu-dropdown").hide();
@@ -23,10 +64,16 @@ $(document).ready(function(){
return false;
});
+
// table sort example
+ // ==================
+
$("#sortTableExample").tablesorter( {sortList: [[1,0]]} );
- // add on
+
+ // add on logic
+ // ============
+
$('.add-on :checkbox').click(function() {
if ($(this).attr('checked')) {
$(this).parents('.add-on').addClass('active');
@@ -34,8 +81,11 @@ $(document).ready(function(){
$(this).parents('.add-on').removeClass('active');
}
});
-
- // Disable certain links and buttons in docs
+
+
+ // Disable certain links in docs
+ // =============================
+
$('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function(e) {
e.preventDefault();
});
@@ -49,39 +99,46 @@ $(document).ready(function(){
});
- // scroll spyer
- var activeTarget,
- $window = $(window),
- position = {},
- nav = $('body > .topbar li a'),
- targets = nav.map(function () {
- return $(this).attr('href');
- }),
- offsets = $.map(targets, function (id) {
- return $(id).offset().top;
- });
+ // POSITION TWIPSIES
+ // =================
+ $('.twipsies.well a').each(function () {
+ var type = this.title
+ , $anchor = $(this)
+ , $twipsy = $('.twipsy.' + type)
- function setButton(id) {
- nav.parent("li").removeClass('active');
- $(nav[$.inArray(id, targets)]).parent("li").addClass('active');
- }
+ , twipsy = {
+ width: $twipsy.width() + 10
+ , height: $twipsy.height() + 10
+ }
- function processScroll(e) {
- var scrollTop = $window.scrollTop() + 10, i;
- for (i = offsets.length; i--;) {
- if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) {
- activeTarget = targets[i];
- setButton(activeTarget);
+ , 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
+ }
}
- }
- }
- nav.click(function () {
- processScroll();
- });
+ $twipsy.css(offset[type])
- processScroll();
+ });
- $window.scroll(processScroll);
}); \ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index d1b924181..1caea7c8f 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -265,8 +265,10 @@
<h6>h6. Heading 6</h6>
</div>
<div class="span6 columns">
- <h3>Example paragraph (body text)</h3>
+ <h3>Example paragraph</h3>
<p>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.</p>
+ <h1>Example heading<small>Has sub-heading...</small></h1>
+ <p>You can also add subheadings with the <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code></p>
</div>
</div>
@@ -1080,6 +1082,37 @@
</div>
</div>
</div>
+ <div class="row">
+ <div class="span4 columns">
+ <h2>Tool Tips</h2>
+ <p>Twipsies are super useful for aiding a confused user and pointing them in the right direction.</p>
+ </div>
+ <div class="span12 columns">
+ <div class="twipsies well">
+ <div style="position: relative">
+ <p class="muted" style="margin-bottom: 0">
+Lorem ipsum dolar sit amet illo error <a href="#" title="below">ipsum</a> veritatis aut iste perspiciatis iste voluptas natus illo quasi odit aut natus consequuntur consequuntur, aut natus illo voluptatem odit perspiciatis laudantium rem doloremque totam voluptas. <a href="#" title="right">Voluptasdicta</a> eaque beatae aperiam ut enim voluptatem explicabo explicabo, voluptas quia odit fugit accusantium totam totam architecto explicabo sit quasi fugit fugit, totam doloremque unde sunt <a href="#" title="left">sed</a> dicta quae accusantium fugit voluptas nemo voluptas voluptatem <a href="#" title="above">rem</a> quae aut veritatis quasi quae.
+ </p>
+ <div class="twipsy below">
+ <div class="twipsy-arrow"></div>
+ <div class="twipsy-inner">below!</div>
+ </div>
+ <div class="twipsy right">
+ <div class="twipsy-arrow"></div>
+ <div class="twipsy-inner">right!</div>
+ </div>
+ <div class="twipsy left">
+ <div class="twipsy-arrow"></div>
+ <div class="twipsy-inner">left!</div>
+ </div>
+ <div class="twipsy above">
+ <div class="twipsy-arrow"></div>
+ <div class="twipsy-inner">above!</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</section>