在fadeOut 中的所有内容都已完全加载并准备好显示后,如何让下面的内容仅淡入?发生的事情是文本框右上角的图像在您第一次加载页面时跳跃并且不平滑淡入,这很烦人。
ps不要问我刚建的网页设计lol
//车内儿童安全苏格兰
$("#link_1").click(function(e) {
e.preventDefault();
var img = $("#childbig2").attr('src');//Get current image
if(img != 'images/childbig.png'){ //Check if current image is the clicked image if not carry on..
//Variables
var imgurl = 'images/childbig.png';
var flag = 'images/scotland.png';
var html = 'Visit the Scottish<br /> In-Car child safety<br /> campaign website. <br /><br /> Expert advice on seat and stage selection for your child. <br /><br />';
html = html + 'Car seat checking clinics - check<br /> when and where they are in your<br /> area for you to attend and have<br /> your seat checked by a Good Egg<br /> In-Car Expert. <br /><br /> News updates, competitions and much much more.';
var linkurl = 'http://www.protectchild.co.uk/';//Link url
$("#content_1").fadeOut(600, function(){//fade out
$("#childbig2").attr('src', imgurl);//change image
$("#childbig2").attr('alt', 'In-Car Child Safety');//change image alt tag
$("#title_img").attr('src', flag);//change flag
$("#title_h2").html('Scotland');//change title
$("#text_title").html('In-Car Child Safety'); //Change second title
$("#text_content").html(html);//Change main text content
$("#weblink").attr('href', linkurl);//Change link url
$("#weblink").attr('title', linkurl);//Change link title
$("#arrowlink").attr('href', linkurl);//Change link on arrow url
$("#arrowlink").attr('title', linkurl);//change link on arrow title
}).fadeIn(600);//fade in speed, miliseconds
}
});