第二屆腳本後,它的後一個使用第一個腳本林有麻煩做兩個jQuery的腳本工作一個接一個
我試着用這個
$(document).ready(function() {
$('div.frame ul#main li a').click(function(){
var toLoad = $(this).attr('href')+' #content';
$('#content').hide('fast',loadContent);
function loadContent() {
$('#content').load(toLoad,'',showNewContent())
}
function showNewContent() {
$('#content').show('normal',hideLoader());
}
function hideLoader() {
$('#load').fadeOut('normal');
}
return false;
});
});
加載它加載後不工作頁面加載使用這一個
$(document).ready(function(e) {
var currentportfolio = $('div#slider ul li:first-child').addClass('show');
var portfolio = $('div#slider ul li');
$('div#slider ul li').not(':first').hide();
$('.prev, .next').click(function() {
// Determine the direction, -1 is prev, 1 is next
var dir = $(this).hasClass('prev') ? -1 : 1;
// Get the li that is currently visible
var current = $('div#slider ul li:visible');
// Get the element that should be shown next according to direction
var new_el = dir < 0 ? current.prev('li') : current.next('li');
// If we've reached the end, select first/last depending on direction
if(new_el.size() == 0) {
new_el = $('div#slider ul li:'+(dir < 0 ? 'last' : 'first'));
}
// Hide them all..
$('div#slider ul li').hide();
// And show the new one
new_el.show();
// Prevent the link from actually redirecting the browser somewhere
return false;
});
});
Im新的jQuery。提前致謝。
流行的觀點相反,你沒有在jQuery的寫這篇文章,您在Javascript寫的。 jQuery是用JavaScript編寫的DOM操作庫... – 2012-07-11 01:04:27
@ElliotBonneville http://i.qkme.me/35p5ss.jpg – Fresheyeball 2012-07-11 01:05:33
你還可以發佈與此一致的HTML嗎? – Daedalus 2012-07-11 01:06:54