Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions cookie,jsonp,拖拽等综合/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}

$parent = $(selector)
selector = selector === '#' ? [] : selector
var $parent = $(document).find(selector)

e && e.preventDefault()

Expand Down Expand Up @@ -451,10 +452,17 @@
* ================= */

$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var $this = $(this)
, options = $.extend({}, $target.data(), $this.data())
, slideIndex

var href = $this.attr('href')
if (href) {
href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
}

var target = $this.attr('data-target') || href
var $target = $(document).find(target)

$target.carousel(options)

Expand Down Expand Up @@ -751,7 +759,7 @@
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}

$parent = selector && $(selector)
var $parent = $(document).find(selector)

if (!$parent || !$parent.length) $parent = $this.parent()

Expand Down Expand Up @@ -1030,8 +1038,11 @@
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
, href = $this.attr('href')
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
var target = $this.attr('data-target') ||
(href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7

var $target = $(document).find(target)
var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())

e.preventDefault()

Expand Down