diff --git "a/cookie,jsonp,\346\213\226\346\213\275\347\255\211\347\273\274\345\220\210/js/bootstrap.js" "b/cookie,jsonp,\346\213\226\346\213\275\347\255\211\347\273\274\345\220\210/js/bootstrap.js" index c298ee4..63a8efb 100644 --- "a/cookie,jsonp,\346\213\226\346\213\275\347\255\211\347\273\274\345\220\210/js/bootstrap.js" +++ "b/cookie,jsonp,\346\213\226\346\213\275\347\255\211\347\273\274\345\220\210/js/bootstrap.js" @@ -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() @@ -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) @@ -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() @@ -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()