You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.3 KiB
70 lines
2.3 KiB
function flashChecker() {
|
|
var hasFlash = 0; //是否安装了flash
|
|
var flashVersion = 0; //flash版本
|
|
if (document.all) {
|
|
var swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
|
|
if (swf) {
|
|
hasFlash = 1;
|
|
VSwf = swf.GetVariable("$version");
|
|
flashVersion = parseInt(VSwf.split(" ")[1].split(",")[0]);
|
|
}
|
|
} else {
|
|
if (navigator.plugins && navigator.plugins.length > 0) {
|
|
var swf = navigator.plugins["Shockwave Flash"];
|
|
if (swf) {
|
|
hasFlash = 1;
|
|
var words = swf.description.split(" ");
|
|
for (var i = 0; i < words.length; ++i) {
|
|
if (isNaN(parseInt(words[i]))) continue;
|
|
flashVersion = parseInt(words[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
f: hasFlash,
|
|
v: flashVersion
|
|
};
|
|
}
|
|
|
|
$(function(){
|
|
$('.yd-close').click(function(){
|
|
$(this).parent().remove();
|
|
});
|
|
|
|
var top = $('.header'),
|
|
nav = $('.d-navs'),
|
|
ml = $('.m-l'),
|
|
piao = $('.piao'),
|
|
nav_h = nav.outerHeight(),
|
|
piao_top = nav_h + 20,
|
|
piao_h = piao.outerHeight(),
|
|
top_h = top.outerHeight() + nav_h - 20,
|
|
ml_top = ml.offset().top;
|
|
$(window).scroll(function(){
|
|
var s_top = $(document).scrollTop(),
|
|
ml_h = ml.outerHeight();
|
|
nav_fixed = 'fixed' == nav.css('position');
|
|
if (s_top > top_h) {
|
|
if (!nav_fixed) {
|
|
nav.css({position:'fixed',top:'-'+nav_h+'px'}).animate({top:'0'},100);
|
|
top.css({marginBottom:nav_h+'px'});
|
|
}
|
|
if (piao_h < ml_h) {
|
|
if (ml_top + ml_h - s_top - piao_h >= piao_top) {
|
|
piao.css({position:'fixed',top:piao_top+'px',marginTop:0});
|
|
} else {
|
|
piao.css({position:'static',marginTop:(ml_h - piao_h)+'px'});
|
|
}
|
|
}
|
|
} else {
|
|
if (nav_fixed) {
|
|
nav.removeAttr('style');
|
|
top.removeAttr('style');
|
|
}
|
|
if ('fixed' == piao.css('position') || '0px' != piao.css('marginTop')) {
|
|
piao.removeAttr('style');
|
|
}
|
|
}
|
|
});
|
|
});
|