자바 스크립트에 문제가 있습니다. 현재 잘 작동하는 두 개의 자바 스크립트 파일이 있지만 단일 파일로 결합하면 첫 번째 쿼리가 작동하고 두 번째 파일은 작동하지 않습니다.한 페이지에서 두 개의 자바 스크립트를 결합하는 방법은 무엇입니까?
$(document).ready(function() {
jcps.fader(200, '#switcher-panel2', '.set2');
jcps.fader(300, '#switcher-panel3', '.set3');
jcps.fader(400, '#switcher-panel4', '.set4');
jcps.fader(500, '#switcher-panel5', '.set5');
});
및
$(document).ready(function() {
$("#lista1").als({
visible_items: 3,
scrolling_items: 2,
orientation: "horizontal",
circular: "yes",
autoscroll: "no",
easing: "linear",
direction: "left",
start_from: 0
});
//logo click
$("#logo_img").click(function() {
location.href = "http://als.musings.it/index.php";
});
$("a[href^='http://']").attr("target", "_blank");
$("a[href^='http://als']").attr("target", "_self");
});
그것은 jQuery를 버전 충돌 문제가 될 수 있습니다. 다른 jQuery 버전을 사용하고 있습니까? jQuery.noConfilict()를 제거하십시오. –
은 같은 페이지에있는 두 개의 javascipt입니까? – SpiderCode
문제는 귀하의 페이지에서 두 개의 $ (document) .ready()를 사용하고 있다는 것입니다. 그것의 insetead는 그것을 단지 한 번 정의하고, 모든 것을 그것 안에 넣는다. 내 대답을 똑같이 보아라. – SpiderCode