bootstrap-source/bootstrap-3.0.3/js/tests/unit/affix.js
author Reimar Bauer <rb.proj AT googlemail DOT com>
Fri, 17 Jan 2014 11:59:43 +0100
branchlanding-page-2014
changeset 78 b28d5c14c5c2
parent 54 0ded9d7748b7
permissions -rwxr-xr-x
merged heads
     1 $(function () {
     2 
     3     module("affix")
     4 
     5       test("should provide no conflict", function () {
     6         var affix = $.fn.affix.noConflict()
     7         ok(!$.fn.affix, 'affix was set back to undefined (org value)')
     8         $.fn.affix = affix
     9       })
    10 
    11       test("should be defined on jquery object", function () {
    12         ok($(document.body).affix, 'affix method is defined')
    13       })
    14 
    15       test("should return element", function () {
    16         ok($(document.body).affix()[0] == document.body, 'document.body returned')
    17       })
    18 
    19       test("should exit early if element is not visible", function () {
    20         var $affix = $('<div style="display: none"></div>').affix()
    21         $affix.data('bs.affix').checkPosition()
    22         ok(!$affix.hasClass('affix'), 'affix class was not added')
    23       })
    24 
    25 })
Impressum Datenschutzerklärung