jqueryプラグイン$

968 ワード

// JavaScript Document
$.fn.Sbox = function(options){
	
	settings = $.extend(true, {
			_ScrollTop:0,
			_Top:0
		}, options);
	
	_width = $(window).width();
	_height = $(window).height();
	_thisWidth = $(this).width();
	_thisheight = $(".innerNewsblack").height();
	_this = this;
	$(this).css({left:_width-_thisWidth,"margin-top":_height});
	$(this).animate({opacity: 100,"margin-top": _height-_thisheight,height: _thisheight },1500);
 
	var scrollfn = function(){
 		 settings._ScrollTop = $(window).scrollTop();
		 var re = /(msie\s7.0;)/i;
		 IEBB = navigator.userAgent.toLowerCase();
		 if(!re.test(IEBB)){
			$(_this).css({"top":settings._Top + settings._ScrollTop+"px"});
		 }
	}
	return $(this).each(function(){
		$(window).scroll(scrollfn);
	});
};