$(function() { var ABI_ORIGINAL_HEIGHT = $(window).height(); $(window).scroll(function(){ var ABI_ORIGINAL_SCROLL = $(this).scrollTop(); if(ABI_ORIGINAL_SCROLL > ABI_ORIGINAL_HEIGHT / 2) { $('html').addClass('fixedActive'); } else { $('html').removeClass('fixedActive'); } }); function filterPath(string) { return string .replace(/^\//,'') .replace(/(index|default).[a-zA-Z]{3,4}$/,'') .replace(/\/$/,''); } var locationPath = filterPath(location.pathname); var scrollElem = scrollableElement('html', 'body'); // Any links with hash tags in them (can't do ^= because of fully qualified URL potential) $('a[href*=#]').each(function() { // Ensure it's a same-page link var thisPath = filterPath(this.pathname) || locationPath; if ( locationPath == thisPath && (location.hostname == this.hostname || !this.hostname) && this.hash.replace(/#/,'') ) { // Ensure target exists var $target = $(this.hash), target = this.hash; if ($target.offset() !== null ){ if (target) { // Find location of target var targetOffset = $target.offset().top; $(this).click(function(event) { // Prevent jump-down event.preventDefault(); // Animate to target $(scrollElem).animate({scrollTop: targetOffset}, 500, function() { // Set hash in URL after animation successful location.hash = target; }); }); } } } }); // Use the first element that is "scrollable" (cross-browser fix?) function scrollableElement(els) { for (var i = 0, argLength = arguments.length; i 0) { return el; } else { $scrollElement.scrollTop(1); var isScrollable = $scrollElement.scrollTop()> 0; $scrollElement.scrollTop(0); if (isScrollable) { return el; } } } return []; } }); //IE7-8 PNG騾乗�繝輔ぅ繝ォ繧ソ繝シ蟇セ遲� $(function() { if(navigator.userAgent.indexOf("MSIE") != -1) { $('img').each(function() { if($(this).attr('src').indexOf('.png') != -1) { $(this).css({ 'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + $(this).attr('src') + '", sizingMethod="scale");' }); } }); } });