2013-03-09 80 views
0

JS初学者在这里。我一直在试图在我的网站上做slabtext,但我得到一个错误。不知道如何解决它。

$(window).load(function() { 
Uncaught TypeError: Property '$' of object [object Object] is not a function 
    slabTextHeadlines(); 
}); 


// Function to slabtext the hero panel 
function slabTextHeadlines() { 
    $('html:not(.ie8)').find('.slab').slabText({ 
     // Don't slabtext the headers if the viewport is under 380px 
     "viewportBreakpoint":380 
    }); 
}; 

任何想法? Pablo。

+1

后的你''标签的内容。你可能没有加载jQuery。 – Blender 2013-03-09 00:21:44

+2

这表明最有可能你没有在这个页面中包含jQuery库,我们可以看到HTML吗? – 2013-03-09 00:21:47

回答

0

你图书馆的jquery插件?像jquery.min?

<script type="text/javascript" src="js/jquery.min" /> 
<script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min" /> 
+0

我想我可能与其他图书馆有冲突。这里是链接[链接] http://www.starsdrivein.com.php53-6.dfw1-1.websitetestlink.com/到页面。 – user2150384 2013-03-11 18:15:19

+0

我看到我看着你的代码。你也有这jquery.slabtext.min.js 和这个jquery.js?ver = 1.8.3 <---我认为这是一个冲突好得多只有一个... – Farnsbert 2013-03-12 02:41:56

0

试试这个:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js" > </script> 
$(window).load(function() { 
    slabTextHeadlines(); 
}); 


// Function to slabtext the hero panel 
function slabTextHeadlines() { 
    $('html:not(.ie8)').find('.slab').slabText({ 
     // Don't slabtext the headers if the viewport is under 380px 
     "viewportBreakpoint":380 
    }); 
}; 
+3

你错过了关闭''标签。您无法自行关闭'