2017-02-09 51 views
0

我已經把代碼放在https://codepen.io/fjenpen/pen/pROPov中,但是當我在https://jsfiddle.net/z05d3ufq/#flexiselDemo3中斷時查看代碼?爲什麼代碼在jsfiddle中破解

$('#flexiselDemo3 a').click(function(e) { 
var target = $(this).attr("href"); 
$(".main .content").not(target).hide(); 
$(target).show(); 
return (false); 
}); 

$(".main .content").hide(); 

var initialTarget = "#Section1"; 

if (location.hash.length > 0) { 
initialTarget = location.hash; 
} 
$(initialTarget).show(); 
+0

看在瀏覽器控制檯。對於初學者,你不包括jQuery –

回答

0

你需要明確包括的jsfiddle控制檯內的jQuery來確保其正確使用:

enter image description here

這些基於瀏覽器的「小提琴」工具往往均需要自己特殊的方式引用外部圖書館,這可以解釋爲什麼它可以在一個而不是另一箇中工作。

相關問題