Javascript 在'';点击'';当.animate代码正在运行时
就像在标题中一样,我使用''动画''在图像上淡入淡入和不透明度:1,但是如果我单击它,如何保持它的缩放和选中Javascript 在'';点击'';当.animate代码正在运行时,javascript,html,css,Javascript,Html,Css,就像在标题中一样,我使用''动画''在图像上淡入淡入和不透明度:1,但是如果我单击它,如何保持它的缩放和选中 函数bigImg5(x){ $(“#imageuk”).animate({不透明度:1,高度:26,宽度:39},250); } 函数normalImg5(x){ $(“#imageuk”).animate({不透明度:0.3,高度:20,宽度:30},250); } 函数bigImg6(x){ $(“#imageitaly”)。设置动画({不透明度:1,高度:26,宽度
函数bigImg5(x){
$(“#imageuk”).animate({不透明度:1,高度:26,宽度:39},250);
}
函数normalImg5(x){
$(“#imageuk”).animate({不透明度:0.3,高度:20,宽度:30},250);
}
函数bigImg6(x){
$(“#imageitaly”)。设置动画({不透明度:1,高度:26,宽度:39},250);
}
函数normalImg6(x){
$(“#imageitaly”).animate({不透明度:0.3,高度:20,宽度:30},250);
}
首先,您刚刚编写了
首先,您刚刚编写了
首先摆脱
首先摆脱
谢谢你的建议。我的代码工作正常,但我想添加一个函数,当用户单击该标记时,该函数将保持选中状态。所有的bests@ProvaAllwinner我已经在我的片段中这样做了。当您单击该标志时,它将保持选中状态。对不起,谢谢。谢谢您的建议。我的代码工作正常,但我想添加一个函数,当用户单击该标记时,该函数将保持选中状态。所有的bests@ProvaAllwinner我已经在我的片段中这样做了。当您单击该标志时,它将保持选中状态。对不起,谢谢。
<img id="imageuk" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/800px-Flag_of_the_United_Kingdom.svg.png" width="30" height="20" class="thumb" style="cursor: pointer;opacity:0.3;border-radius:3px;" onmouseover="bigImg5(this)" onmouseout="normalImg5(this)" onclick="language_2()">
<img id="imageitaly" src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/03/Flag_of_Italy.svg/800px-Flag_of_Italy.svg.png" width="30" height="20" class="thumb" style="cursor: pointer;opacity:0.3;border-radius:3px;" onmouseover="bigImg6(this)" onmouseout="normalImg6(this)" onclick="language_1()">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function bigImg5(x) {
$("#imageuk").animate({opacity: 1,height: 26, width: 39}, 250 );
}
function normalImg5(x) {
$("#imageuk").animate({opacity: 0.3,height: 20, width: 30}, 250 );
}
function bigImg6(x) {
$("#imageitaly").animate({opacity: 1,height: 26, width: 39}, 250 );
}
function normalImg6(x) {
$("#imageitaly").animate({opacity: 0.3,height: 20, width: 30}, 250 );
}
</script>