jquery原生事件不响应,该怎么处理
jquery原生事件不响应
点击执行动画没有效果?请问是什么原因
<html>
<title>index</title>
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<meta content="text/html;charset=utf-8" http-equiv="content-type"/>
<link rel="stylesheet" href="resources/css/flexslider.css" type="text/css" media="screen" />
<link href="resources/css/jquery.mobile-1.3.2.css" rel="stylesheet" type="text/css" />
<script src="resources/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="resources/js/jquery.mobile-1.3.2.js" type="text/javascript"></script>
<script src="resources/js/jquery.flexslider.js"></script>
<link rel="stylesheet" href="resources/css/demo.css" type="text/css" media="screen" />
<style>
*{padding: 0;margin: 0}
.left{ float: left;width: 50%;position: relative; }
.right{ float: right; width: 50%;position: relative;}
.left img{position: absolute; width: 100%;height: 100%}
.right img{position: absolute;width: 100%;height: 100%}
.parent{background: #000000;padding: 0px!important;}
</style>
</head>
<body>
<div id="container" data-content="header">
<div class="flexslider">
<ul class="slides">
<li>
<img src="resources/images/inacup_donut.jpg" />
<p class="flex-caption">Captions and cupcakes. Winning combination.</p>
</li>
<li>
<a href="http://flex.madebymufffin.com"><img src="resources/images/inacup_pumpkin.jpg" /></a>
<p class="flex-caption">This image is wrapped in a link!</p>
</li>
<li>
<img src="resources/images/inacup_donut.jpg" />
</li>
<li>
<img src="resources/images/inacup_vanilla.jpg" />
</li>
</ul>
</div>
</div>
<div class="parent">
</div>
<script type="text/javascript">
var allwidth = $(window).width();
var current_img;
$(window).load(function() {
current_img = allwidth/2;
$('.flexslider').flexslider();
for (var i=0; i < 6; i++) {
if(i%2===0){
$('.parent').append('<div class="left" style="height:'+current_img+'px"></div>');
$('.parent').append('<div class="right" style="height:'+current_img/2+'px"></div>');
}else{
$('.parent').append('<div class="right" style="height:'+current_img+'px"></div>');
$('.parent').append('<div class="left" style="height:'+current_img/2+'px"></div>');
}
};
$('.left').each(function(index) {
$(this).append('<img id="hihi" src="resources/images/fullscreen.JPG" />');
});
$('.right').each(function(index) {
$(this).append('<img id="hihi" src="resources/images/fullscreen.JPG" />');
});
});
$(window).resize(function() {
$('.left').each(function(index) {
current_img = $(this).width();
var current_background = $(this).css("background-color");
if(index%2==0){
$(this).css("height",current_img);
}else{
$(this).css("height",current_img/2);
}
$(this).css("background",current_background);
});
$('.right').each(function(index) {
var current = $(this).width();
current_background = $(this).css("background-color");
if(index%2==0){
$(this).css("height",current_img/2);
$(this).css("background",current_background);
}else{
$(this).css("height",current_img);
$(this).css("background",current_background);
}
});
});
$('#hihi').click(function(){
console.log(current_img);
$(this).animate({
height:current_img*0.75,width:current_img*0.75,
left:$(this).width()/8,
top:$(this).height()/8
},1000);
});
</script>
</body>
</html>
点击执行动画没有效果?请问是什么原因
文章评论
相关解决方案
- 1Button控制PopupControlExtender,但为什么Button的onclick事件不响应了啊该怎么处理
- 2Spinner 不响应setOnItemSelectedListener事件,该怎么处理
- 3asp.net 中TextBox控件不响应ontextchanged事件,该怎么处理
- 4子对话框 不响应菜单,该怎么处理
- 5GridView中定义的CommandField 不响应。需高手帮助!该怎么处理
- 6VS2010中view类的OnDraw不响应,该怎么处理
- 7arm-linux串口输出正常,GPRS模块不响应,该怎么处理
- 8silverlight事件不响应解决办法
- 9窗体怎么响应键盘事件?窗体的KEYdown事件不响应呢?
- 10VMWare的mac os虚拟机长时间没交互,虚拟机很多时候就不响应了,为何?该怎么处理