내 전체 스크립트가 실행되고 있지만 div를 클릭하면 div가 숨기고있는 것은 아니지만 숨길 코드가 생겼습니다 .... 내가 실수 한 부분을 말해 줄 수 있습니다.jquery를 사용하여 사용자 정의 효과로 DIV 표시
여기 내 코드
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.lnkcss
{
margin-left:350px;
}
.BusyStyles
{
background-image: url('images/ajax-loader.gif');
background-repeat: no-repeat; background-position: center center;
}
#transition {
display:none;
position:absolute; top:50%; left:50%; z-index:50;
border:1px solid #666;
width:100px; height:100px;
}
</style>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#lnk').click(function (e) {
$('body').append('<div id="transition"></div>').show();
var $t = $('#transition'),
to = $(this).offset(),
td = $(document);
//$t.children('div').css({ width: 100, height: 100 });
$t.css({
top: to.top + 50,
left: to.left + 50,
display: 'block'
}).animate({
top: td.height()/2,
left: td.width()/2
}, 600, function() {
$(this).animate({
top: '-=75',
left: '-=50'
}, 600);
$(this).animate({
width: 250,
height: 200
}, 600, function() {
$('#transition').addClass("BusyStyles");
});
});
return false;
});
$('#transition').click(function (e) {
alert('pp');
$(this).hide();
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<a href="#" id='lnk' class="lnkcss">FeedBack</a>
</form>
</body>
</html>
$('#transition').click(function (e) {
alert('pp');
$(this).hide();
});
내가 DIV 숨길 쓴 위의 라인이지만 내가 사업부를 클릭하면 아무것도 일어나지 않을 것입니다.
위의 스크립트는 IE 8에서 같은 방식으로 작동하지 않는 주요한 것들. IE에서 스크립트를 실행하면 u가 차이를 보일 것입니다. 그래서 IE를위한 좋은 수정이 될 것입니다. 감사. – Thomas