1
안녕하세요, 저는이 미리 작성된 jQuery 스크립트와 인스턴트 메신저를 통해 누군가 나를 큰 도움을 줄 수 있는지 확인하고 스크립트가 어디에 있는지 보여 주어 스크립트를 통해 레이어를 제거 할 수 있는지 궁금해합니다. 클릭하면 .. 사람을 리디렉션 그것이 것을 감사합니다 :)게시물 - jQuery를 덮고있는 리디렉션 레이어를 제거하려면 어떻게합니까?
소스 코드를 게시 :
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.scrollTo-1.4.2.js"></script>
<script type="text/javascript">
//when the DOM is ready
$(document).ready(function(){
//settings on top
var doindex = 'comments.php?item_id=';
var initialPosts = <?php echo get_posts(0,$_SESSION['posts_start']); ?>;
//function that creates posts
var postHandler = function(postsJSON) {
$.each(postsJSON,function(i,post) {
//post url
var postURL = '' + doindex + post.item_id;
var id = 'post-' + post.ID;
//create the HTML
$('<div></div>')
.addClass('post')
.attr('id',id)
//generate the HTML
.html('<table width="244" height="101" border="0" cellpadding="0" cellspacing="2" ><tr> <td height="24" colspan="2" bgcolor="#0270B7"><table width="410" border="0"><tr> <td width="404" height="20" class="username"><a href="../profile.php?user=' + post.username + '" class="username"> ' + post.username + '<span class="name"> ' + post.name + '</span></a></td></tr></table></td></tr><tr> <td width="51" bgcolor="#Edeff4"><span class="thum"><img src="' + post.thumnailpath + '" alt="" width="50" height="50" /></span></td><td width="355" height="50" bgcolor="#Edeff4" class="content"> ' + post.item_content + '</td></tr><tr><td height="19" colspan="2" bgcolor="#Edeff4" class="content"><table width="404" border="0"> <tr class="post-title"><td width="171" height="28" class="links"> <a href="comment.php?id=' + post.item_id + '" class="post-title"> <span class="post-title">comment </span></a><a href="#" class="post-title">(' + post.likecount + '</a><a href="comment.php?id=' + post.item_id + '" class="post-title"><span class="post-title">)</span></a> <span class="post-title"><a href="#" class="post-title">likes (' + post.likecount + ')</a></span></td><td width="223" >' + post.timeago + '</td></tr></table></td></tr></table>')
.click(function() {
window.location = postURL;
})
//inject into the container
.appendTo($('#posts'))
.hide()
.slideDown(250,function() {
if(i == 0) {
$.scrollTo($('div#' + id));
}
});
});
};
//place the initial posts in the page
postHandler(initialPosts);
//first, take care of the "load more"
//when someone clicks on the "load more" DIV
var start = <?php echo $_SESSION['posts_start']; ?>;
var desiredPosts = <?php echo $number_of_posts; ?>;
var loadMore = $('#load-more');
//load event/ajax
loadMore.click(function(){
//add the activate class and change the message
loadMore.addClass('activate').text('Loading...');
//begin the ajax attempt
$.ajax({
url: 'jquery-version.php',
data: {
'start': start,
'desiredPosts': desiredPosts
},
type: 'get',
dataType: 'json',
cache: false,
success: function(responseJSON) {
//reset the message
loadMore.text('Load More');
//increment the current status
start += desiredPosts;
//add in the new posts
postHandler(responseJSON);
},
//failure class
error: function() {
//reset the message
loadMore.text('Oops! Try Again.');
},
//complete event
complete: function() {
//remove the spinner
loadMore.removeClass('activate');
}
});
});
});
</script>
</head>