mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
adds twipsy js to regular index for positioning
This commit is contained in:
@@ -46,7 +46,7 @@ section > .row {
|
||||
font-weight: bold;
|
||||
}
|
||||
#masthead {
|
||||
margin-top: 40px;
|
||||
padding-top: 40px;
|
||||
}
|
||||
#masthead h1,
|
||||
#masthead p {
|
||||
@@ -175,6 +175,7 @@ section > .row {
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.075);
|
||||
}
|
||||
.diagram {
|
||||
height: 140px;
|
||||
padding: 4px;
|
||||
}
|
||||
.mini-layout {
|
||||
|
||||
@@ -42,42 +42,15 @@ $(document).ready(function(){
|
||||
// POSITION STATIC 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])
|
||||
});
|
||||
$(".twipsies a").each(function () {
|
||||
$(this)
|
||||
.twipsy({
|
||||
live: false
|
||||
, placement: $(this).attr('title')
|
||||
, trigger: 'manual'
|
||||
, offset: 2
|
||||
})
|
||||
.trigger('twipsy:show')
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user