以下是 jQuery列表递推手风琴特效代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery列表递推手风琴</title>
<script src="js/jquery-1.8.3.min.js"></script>
<link rel="stylesheet" href="css/newsWidget.css" />
<link rel="stylesheet" href="css/newsWidget_color.css" />
<script src="js/greensocks/TweenMax.min.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/jquery.jfeed.pack.js"></script>
<script src="js/jquery.newsWidget.min.js"></script>
<!--<link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">-->
</head>
<body>
<div class="container">
<section class="col-lg-10 col-lg-offset-1">
<div style="width:960px; margin:0 auto;position:relative;">
<ul id="mainNewsWidget">
<li data-title="Press on Read More to Open" data-date="12-2-2013" data-image="images/img/1.jpg">
<h2>2 Different Styles to continue reading this.</h2>
<br />
<strong>The Full page Style</strong> and <strong>In-Widget Style</strong>.<p>
This is the full page view. Check examples for the In-widget.<br />
</p>
<br />
<p>Lorem ipsum dolor <strong>sit</strong> amet, <span>consectetuer</span>
<em>adipiscing elit</em>, sed diam nonummy nibh euismod tincidunt
ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim
veniam, quis nostrud exerci tation ullamcorper suscipit lobortis
nisl ut aliquip ex ea commodo consequat.</p>
<ul style="list-style:square; margin-bottom:5px;">
<li>sdasd</li>
<li>dsdd</li>
</ul>
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril.<p></p>
<img src="images/img/1.jpg" width="200" height="120" class="img-rounded">
<p>link <strong>Strong Text</strong>,
<em>em</em></p>
<p><button type="button" class="btn btn-primary">Primary
</button></p>
<p>delenit augue duis dolore te feugait nulla facilisi. Nam liber
tempor cum soluta nobis eleifend option congue nihil imperdiet doming
id quod mazim placerat facer possim assum. Typi non habent claritatem
insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes
demonstraverunt lectores legere me lius quod ii legunt saepius.
Claritas est etiam processus dynamicus, qui sequitur mutationem
consuetudium lectorum. Mirum est notare quam littera gothica, quam
nunc putamus parum claram, anteposuerit litterarum formas humanitatis
per seacula quarta decima et quinta decima. Eodem modo typi, qui
nunc nobis videntur parum clari, fiant sollemnes in futurum. Lorem
ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper
suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis
autem vel eum iriure dolor in hendrerit in vulputate velit esse
molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci
tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate
velit esse molestie consequat, vel illum dolore eu feugiat nulla
facilisis at vero eros et accumsan et iusto odio dignissim qui blandit
praesent luptatum zzril delenit augue duis dolore te feugait nulla
facilisi. Nam liber tempor cum soluta nobis eleifend option congue
nihil imperdiet doming id quod mazim placerat facer possim assum.
Typi non habent claritatem insitam; est usus legentis in iis qui
facit eorum claritatem. Investigationes demonstraverunt lectores
legere me lius quod ii legunt saepius. Claritas est etiam processus
dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum
est notare quam littera gothica, quam nunc putamus parum claram,
anteposuerit litterarum formas humanitatis per seacula quarta decima
et quinta decima. Eodem modo typi, qui nunc nobis videntur parum
clari, fiant sollemnes in futurum.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci
tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate
velit esse molestie consequat, vel illum dolore eu feugiat nulla
facilisis at vero eros et accumsan et iusto odio dignissim qui blandit
praesent luptatum zzril delenit augue duis dolore te feugait nulla
facilisi. Nam liber tempor cum soluta nobis eleifend option congue
nihil imperdiet doming id quod mazim placerat facer possim assum.
Typi non habent claritatem insitam; est usus legentis in iis qui
facit eorum claritatem. Investigationes demonstraverunt lectores
legere me lius quod ii legunt saepius. Claritas est etiam processus
dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum
est notare quam littera gothica, quam nunc putamus parum claram,
anteposuerit litterarum formas humanitatis per seacula quarta decima
et quinta decima. Eodem modo typi, qui nunc nobis videntur parum
clari, fiant sollemnes in futurum.</p>
</li>
<li data-title="Links can be direct or as Read More buttons inside the News Reader" data-date="12-2-2013" data-image="images/img/2.jpg" data-link="#" data-link-type="readmore">
Links can be 2 types <strong>"readmore"</strong> links and
<strong>"direct"</strong> links. <br />
The readmore type will add a Continue reading button at the end
of the article however the direct type will open the article in
a new tab (can be self). <br>
To define a readmore link, add <strong>data-link-type</strong> to
the list item. Otherwise the link will be direct.<br>
<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</li>
<li data-title="This item is an external link" data-date="12-2-2013" data-image="images/img/2.jpg" data-link="#">
When this is pressed, the user will be redirected to a link predefined.
You can set the target.</li>
<li data-title="Custome Link Text, hover when chosen to check." data-date="12-2-2013" data-link-text="View " data-title-in-link="after">
<div class="cssCustomization">
<h3>You can add custom link text to any specific item.</h3>
You can also choose to show the title or not, and where.<br />
<br />
Add to any news item the following code and viola!: <br />
<br />
<pre>data-link-text="CUSTOM LINK TEXT!" <br />data-title-in-link="none"</pre>
<br />
<p><span>data-title-in-link</span>: Control whether the title
is included in the custom link text. Values: <span>"before"</span>,
<span>"after"</span> or <span>"none"</span></p>
</div>
</li>
<li data-title="8 Different Arrow Layouts" data-date="12-2-2013">
The plugin includes 8 different Arrow layouts including:
<ul style="margin-left:290px; list-style:square">
<li>left </li>
<li>right </li>
<li>sides </li>
<li>top-left </li>
<li>top-right </li>
<li>bottom-left </li>
<li>bottom-right </li>
<li>top/bottom </li>
</ul>
<br />
<br />
<img src="images/img/arrows.jpg" width="500" /> Lorem ipsum dolor
sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi
enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel
eum iriure dolor in hendrerit in vulputate velit esse molestie consequat,
vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan
et iusto odio dignissim qui blandit praesent luptatum zzril delenit
augue duis dolore te feugait nulla facilisi. Nam liber tempor cum
soluta nobis eleifend option congue nihil imperdiet doming id quod
mazim placerat facer possim assum. Typi non habent claritatem insitam;
est usus legentis in iis qui facit eorum claritatem. Investigationes
demonstraverunt lectores legere me lius quod ii legunt saepius.
Claritas est etiam processus dynamicus, qui sequitur mutationem
consuetudium lectorum. Mirum est notare quam littera gothica, quam
nunc putamus parum claram, anteposuerit litterarum formas humanitatis
per seacula quarta decima et quinta decima. Eodem modo typi, qui
nunc nobis videntur parum clari, fiant sollemnes in futurum.</li>
<li data-title="Supports RSS Feeds!" data-date="12-2-2013">The plugin
supports external/internal RSS Feeds. You can set the number of
items to load. You must use a proxy to load external rss feeds,
i included one. It is a basic one. Prefferable to use a more advanced
and secure one. Google links to many.<br />
<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</li>
<li data-title="Set Height or Set Number of News" data-date="10-1-2013" data-image="images/img/5.jpg">
The plugin is smart. You can either set the height of the plugin
and it will calcualte the number of news to initially display on
screen. If you prefer to choose them yourself, you can! Simply set
the numberOfNews option to any number and the plugin will calculate
the new height! </li>
<li data-title="Multiple Animations Included" data-date="17-11-2012" data-image="images/img/girl.jpg">
<h2>You can customize all animations and control all their aspects.</h2>
<br />
You can choose how the widget appears, how the article shows, how
it closes and how the items react to your hovers. You can also set
teh animations duration, delay and easing. <br />
<br />
I've included 10 animations:
<ul style="list-style:square; margin:20px; margin-left:100px;">
<li>left </li>
<li>right </li>
<li>sides </li>
<li>top-left </li>
<li>top-right </li>
<li>bottom-left </li>
<li>bottom-right </li>
<li>top/bottom </li>
</ul>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</li>
<li data-title="Image with Overrided options" data-date="12-2-2013" data-image="images/img/girl.jpg" data-image-cropping="false">
A Sexy Girl.</li>
<li data-title="Title of the News" data-date="12-2-2013" data-image="images/img/1.jpg">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</li>
<li data-title="Easy Styling using Css." data-date="12-2-2013" data-image="images/img/2.jpg">
You can dramatically change everything using css. You can edit the
sizes, colors, animtions and the whole feel. You can also add custom
style to the News Readers. All documented.<br />
<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit
esse molestie consequat, vel illum dolore eu feugiat nulla facilisis
at vero eros et accumsan et iusto odio dignissim qui blandit praesent
luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet
doming id quod mazim placerat facer possim assum. Typi non habent
claritatem insitam; est usus legentis in iis qui facit eorum claritatem.
Investigationes demonstraverunt lectores legere me lius quod ii
legunt saepius. Claritas est etiam processus dynamicus, qui sequitur
mutationem consuetudium lectorum. Mirum est notare quam littera
gothica, quam nunc putamus parum claram, anteposuerit litterarum
formas humanitatis per seacula quarta decima et quinta decima. Eodem
modo typi, qui nunc nobis videntur parum clari, fiant sollemnes
in futurum.</li>
</ul>
</div>
</section>
</div>
<script>
jQuery(document).ready(function() {
$("#mainNewsWidget").newsWidget({
currentNewsWidth: 600,
currentNewsHeight:250,
fullArticleType : "full" ,
navBtns: "sides",
closedNewsWidth:600,
closedNewsPosition:"left",
closedNewsOffset:0,
widgetOpenType: "fadeLeft",
fullArticleOpen: "fadeDown",
fullArticleClose: "fadeUp",
linkText:"Open > " ,
titleInLink : "after"
});
});
</script>
</body>
</html>
JS代码(jquery.mCustomScrollbar.concat.min.js):
/*plugin home:http://manos.malihu.gr/jquery-custom-content-scroller */
(function(a){
function d(b){
var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;
return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}
var b=["DOMMouseScroll","mousewheel"];
if(a.event.fixHooks)for(var c=b.length;
c;
)a.event.fixHooks[b[--c]]=a.event.mouseHooks;
a.event.special.mousewheel={
setup:function(){
if(this.addEventListener)for(var a=b.length;
a;
)this.addEventListener(b[--a],d,!1);
else this.onmousewheel=d}
,teardown:function(){
if(this.removeEventListener)for(var a=b.length;
a;
)this.removeEventListener(b[--a],d,!1);
else this.onmousewheel=null}
}
,a.fn.extend({
mousewheel:function(a){
return a?this.bind("mousewheel",a):this.trigger("mousewheel")}
,unmousewheel:function(a){
return this.unbind("mousewheel",a)}
}
)}
)(jQuery);
/*custom scrollbar*/
(function(c){
var b={
init:function(e){
var f={
set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{
enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40}
,advanced:{
updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false}
,contentTouchScroll:true,callbacks:{
onScrollStart:function(){
}
,onScroll:function(){
}
,onTotalScroll:function(){
}
,onTotalScrollBack:function(){
}
,onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){
}
}
,theme:"light"}
,e=c.extend(true,f,e);
return this.each(function(){
var m=c(this);
if(e.set_width){
m.css("width",e.set_width)}
if(e.set_height){
m.css("height",e.set_height)}
if(!c(document).data("mCustomScrollbar-index")){
c(document).data("mCustomScrollbar-index","1")}
else{
var t=parseInt(c(document).data("mCustomScrollbar-index"));
c(document).data("mCustomScrollbar-index",t+1)}
m.wrapInner("<div class='mCustomScrollBox mCS-"+e.theme+"' id='mCSB_"+c(document).data("mCustomScrollbar-index")+"' style='position:relative;
height:100%;
overflow:hidden;
max-width:100%;
' />").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));
var g=m.children(".mCustomScrollBox");
if(e.horizontalScroll){
g.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative;
left:0;
width:999999px;
' />");
var k=g.children(".mCSB_h_wrapper");
k.wrapInner("<div class='mCSB_container' style='position:absolute;
left:0;
' />").children(".mCSB_container").css({
width:k.children().outerWidth(),position:"relative"}
).unwrap()}
else{
g.wrapInner("<div class='mCSB_container' style='position:relative;
top:0;
' />")}
var o=g.children(".mCSB_container");
if(c.support.touch){
o.addClass("mCS_touch")}
o.after("<div class='mCSB_scrollTools' style='position:absolute;
'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;
' oncontextmenu='return false;
'><div class='mCSB_dragger_bar' style='position:relative;
'></div></div><div class='mCSB_draggerRail'></div></div></div>");
var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");
if(e.horizontalScroll){
q.data("minDraggerWidth",q.width())}
else{
q.data("minDraggerHeight",q.height())}
if(e.scrollButtons.enable){
if(e.horizontalScroll){
l.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;
'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;
'></a>")}
else{
l.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;
'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;
'></a>")}
}
g.bind("scroll",function(){
if(!m.is(".mCS_disabled")){
g.scrollTop(0).scrollLeft(0)}
}
);
m.data({
mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false}
);
if(e.horizontalScroll){
if(m.css("max-width")!=="none"){
if(!e.advanced.updateOnContentResize){
e.advanced.updateOnContentResize=true}
}
}
else{
if(m.css("max-height")!=="none"){
var s=false,r=parseInt(m.css("max-height"));
if(m.css("max-height").indexOf("%")>=0){
s=r,r=m.parent().height()*s/100}
m.css("overflow","hidden");
g.css("max-height",r)}
}
m.mCustomScrollbar("update");
if(e.advanced.updateOnBrowserResize){
var i,j=c(window).width(),u=c(window).height();
c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){
if(i){
clearTimeout(i)}
i=setTimeout(function(){
if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){
var w=c(window).width(),v=c(window).height();
if(j!==w||u!==v){
if(m.css("max-height")!=="none"&&s){
g.css("max-height",m.parent().height()*s/100)}
m.mCustomScrollbar("update");
j=w;
u=v}
}
}
,150)}
)}
if(e.advanced.updateOnContentResize){
var p;
if(e.horizontalScroll){
var n=o.outerWidth()}
else{
var n=o.outerHeight()}
p=setInterval(function(){
if(e.horizontalScroll){
if(e.advanced.autoExpandHorizontalScroll){
o.css({
position:"absolute",width:"auto"}
).wrap("<div class='mCSB_h_wrapper' style='position:relative;
left:0;
width:999999px;
' />").css({
width:o.outerWidth(),position:"relative"}
).unwrap()}
var v=o.outerWidth()}
else{
var v=o.outerHeight()}
if(v!=n){
m.mCustomScrollbar("update");
n=v}
}
,300)}
}
)}
,update:function(){
var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");
q.removeClass("mCS_no_scrollbar");
n.removeClass("mCS_disabled mCS_destroyed");
k.scrollTop(0).scrollLeft(0);
var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");
if(n.data("horizontalScroll")){
var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();
if(n.data("autoExpandHorizontalScroll")){
q.css({
position:"absolute",width:"auto"}
).wrap("<div class='mCSB_h_wrapper' style='position:relative;
left:0;
width:999999px;
' />").css({
width:q.outerWidth(),position:"relative"}
).unwrap()}
var z=q.outerWidth()}
else{
var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}
if(i>r&&!n.data("horizontalScroll")){
y.css("display","block");
var s=o.height();
if(n.data("autoDraggerLength")){
var u=Math.round(r/i*s),l=m.data("minDraggerHeight");
if(u<=l){
m.css({
height:l}
)}
else{
if(u>=s-10){
var p=s-10;
m.css({
height:p}
)}
else{
m.css({
height:u}
)}
}
m.children(".mCSB_dragger_bar").css({
"line-height":m.height()+"px"}
)}
var B=m.height(),x=(i-r)/(s-B);
n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);
var D=Math.abs(q.position().top);
n.mCustomScrollbar("scrollTo",D,{
scrollInertia:0,trigger:"internal"}
)}
else{
if(z>f&&n.data("horizontalScroll")){
y.css("display","block");
var h=o.width();
if(n.data("autoDraggerLength")){
var j=Math.round(f/z*h),C=m.data("minDraggerWidth");
if(j<=C){
m.css({
width:C}
)}
else{
if(j>=h-10){
var e=h-10;
m.css({
width:e}
)}
else{
m.css({
width:j}
)}
}
}
var v=m.width(),x=(z-f)/(h-v);
n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);
var D=Math.abs(q.position().left);
n.mCustomScrollbar("scrollTo",D,{
scrollInertia:0,trigger:"internal"}
)}
else{
k.unbind("mousewheel focusin");
if(n.data("horizontalScroll")){
m.add(q).css("left",0)}
else{
m.add(q).css("top",0)}
y.css("display","none");
q.addClass("mCS_no_scrollbar");
n.data({
bindEvent_mousewheel:false,bindEvent_focusin:false}
)}
}
}
,scrolling:function(h,p,m,j,w,e,A,v){
var k=c(this);
if(!k.data("bindEvent_scrollbar_drag")){
var n,o;
if(c.support.msPointer){
j.bind("MSPointerDown",function(H){
H.preventDefault();
k.data({
on_drag:true}
);
j.addClass("mCSB_dragger_onDrag");
var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;
if(F<G.width()&&F>0&&I<G.height()&&I>0){
n=I;
o=F}
}
);
c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){
H.preventDefault();
if(k.data("on_drag")){
var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;
D(n,o,I,F)}
}
).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){
k.data({
on_drag:false}
);
j.removeClass("mCSB_dragger_onDrag")}
)}
else{
j.bind("mousedown touchstart",function(H){
H.preventDefault();
H.stopImmediatePropagation();
var G=c(this),K=G.offset(),F,J;
if(H.type==="touchstart"){
var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];
F=I.pageX-K.left;
J=I.pageY-K.top}
else{
k.data({
on_drag:true}
);
j.addClass("mCSB_dragger_onDrag");
F=H.pageX-K.left;
J=H.pageY-K.top}
if(F<G.width()&&F>0&&J<G.height()&&J>0){
n=J;
o=F}
}
).bind("touchmove",function(H){
H.preventDefault();
H.stopImmediatePropagation();
var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;
D(n,o,I,F)}
);
c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){
if(k.data("on_drag")){
var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;
D(n,o,I,F)}
}
).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){
k.data({
on_drag:false}
);
j.removeClass("mCSB_dragger_onDrag")}
)}
k.data({
bindEvent_scrollbar_drag:true}
)}
function D(G,H,I,F){
if(k.data("horizontalScroll")){
k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{
moveDragger:true,trigger:"internal"}
)}
else{
k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{
moveDragger:true,trigger:"internal"}
)}
}
if(c.support.touch&&k.data("contentTouchScroll")){
if(!k.data("bindEvent_content_touch")){
var l,B,r,s,u,C,E;
p.bind("touchstart",function(x){
x.stopImmediatePropagation();
l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];
B=c(this);
r=B.offset();
u=l.pageX-r.left;
s=l.pageY-r.top;
C=s;
E=u}
);
p.bind("touchmove",function(x){
x.preventDefault();
x.stopImmediatePropagation();
l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];
B=c(this).parent();
r=B.offset();
u=l.pageX-r.left;
s=l.pageY-r.top;
if(k.data("horizontalScroll")){
k.mCustomScrollbar("scrollTo",E-u,{
trigger:"internal"}
)}
else{
k.mCustomScrollbar("scrollTo",C-s,{
trigger:"internal"}
)}
}
)}
}
if(!k.data("bindEvent_scrollbar_click")){
m.bind("click",function(F){
var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);
if(k.data("horizontalScroll")){
x=(F.pageX-m.offset().left)*k.data("scrollAmount")}
if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){
k.mCustomScrollbar("scrollTo",x,{
trigger:"internal",scrollEasing:"draggerRailEase"}
)}
}
);
k.data({
bindEvent_scrollbar_click:true}
)}
if(k.data("mouseWheel")){
if(!k.data("bindEvent_mousewheel")){
h.bind("mousewheel",function(H,J){
var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();
if(k.data("normalizeMouseWheelDelta")){
if(J<0){
J=-1}
else{
J=1}
}
if(F==="auto"){
F=100+Math.round(k.data("scrollAmount")/2)}
if(k.data("horizontalScroll")){
I=j.position().left;
y=m.width()-j.width();
x=Math.abs(p.position().left)}
if((J>0&&I!==0)||(J<0&&I!==y)){
H.preventDefault();
H.stopImmediatePropagation()}
G=x-(J*F);
k.mCustomScrollbar("scrollTo",G,{
trigger:"internal"}
)}
);
k.data({
bindEvent_mousewheel:true}
)}
}
if(k.data("scrollButtons_enable")){
if(k.data("scrollButtons_scrollType")==="pixels"){
if(k.data("horizontalScroll")){
v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);
k.data({
bindEvent_buttonsContinuous_x:false}
);
if(!k.data("bindEvent_buttonsPixels_x")){
v.bind("click",function(x){
x.preventDefault();
q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))}
);
A.bind("click",function(x){
x.preventDefault();
q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))}
);
k.data({
bindEvent_buttonsPixels_x:true}
)}
}
else{
e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);
k.data({
bindEvent_buttonsContinuous_y:false}
);
if(!k.data("bindEvent_buttonsPixels_y")){
e.bind("click",function(x){
x.preventDefault();
q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))}
);
w.bind("click",function(x){
x.preventDefault();
q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))}
);
k.data({
bindEvent_buttonsPixels_y:true}
)}
}
function q(x){
if(!j.data("preventAction")){
j.data("preventAction",true);
k.mCustomScrollbar("scrollTo",x,{
trigger:"internal"}
)}
}
}
else{
if(k.data("horizontalScroll")){
v.add(A).unbind("click");
k.data({
bindEvent_buttonsPixels_x:false}
);
if(!k.data("bindEvent_buttonsContinuous_x")){
v.bind("mousedown touchstart MSPointerDown",function(y){
y.preventDefault();
var x=z();
k.data({
mCSB_buttonScrollRight:setInterval(function(){
k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{
trigger:"internal",scrollEasing:"easeOutCirc"}
)}
,17)}
)}
);
var i=function(x){
x.preventDefault();
clearInterval(k.data("mCSB_buttonScrollRight"))}
;
v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);
A.bind("mousedown touchstart MSPointerDown",function(y){
y.preventDefault();
var x=z();
k.data({
mCSB_buttonScrollLeft:setInterval(function(){
k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{
trigger:"internal",scrollEasing:"easeOutCirc"}
)}
,17)}
)}
);
var g=function(x){
x.preventDefault();
clearInterval(k.data("mCSB_buttonScrollLeft"))}
;
A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);
k.data({
bindEvent_buttonsContinuous_x:true}
)}
}
else{
e.add(w).unbind("click");
k.data({
bindEvent_buttonsPixels_y:false}
);
if(!k.data("bindEvent_buttonsContinuous_y")){
e.bind("mousedown touchstart MSPointerDown",function(y){
y.preventDefault();
var x=z();
k.data({
mCSB_buttonScrollDown:setInterval(function(){
k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{
trigger:"internal",scrollEasing:"easeOutCirc"}
)}
,17)}
)}
);
var t=function(x){
x.preventDefault();
clearInterval(k.data("mCSB_buttonScrollDown"))}
;
e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);
w.bind("mousedown touchstart MSPointerDown",function(y){
y.preventDefault();
var x=z();
k.data({
mCSB_buttonScrollUp:setInterval(function(){
k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{
trigger:"internal",scrollEasing:"easeOutCirc"}
)}
,17)}
)}
);
var f=function(x){
x.preventDefault();
clearInterval(k.data("mCSB_buttonScrollUp"))}
;
w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);
k.data({
bindEvent_buttonsContinuous_y:true}
)}
}
function z(){
var x=k.data("scrollButtons_scrollSpeed");
if(k.data("scrollButtons_scrollSpeed")==="auto"){
x=Math.round((k.data("scrollInertia")+100)/40)}
return x}
}
}
if(k.data("autoScrollOnFocus")){
if(!k.data("bindEvent_focusin")){
h.bind("focusin",function(){
h.scrollTop(0).scrollLeft(0);
var x=c(document.activeElement);
if(x.is("input,textarea,select,button,a[tabindex],area,object")){
var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();
if(k.data("horizontalScroll")){
G=p.position().left;
y=x.position().left;
F=h.width()-x.outerWidth()}
if(G+y<0||G+y>F){
k.mCustomScrollbar("scrollTo",y,{
trigger:"internal"}
)}
}
}
);
k.data({
bindEvent_focusin:true}
)}
}
if(k.data("autoHideScrollbar")){
if(!k.data("bindEvent_autoHideScrollbar")){
h.bind("mouseenter",function(x){
h.addClass("mCS-mouse-over");
d.showScrollbar.call(h.children(".mCSB_scrollTools"))}
).bind("mouseleave touchend",function(x){
h.removeClass("mCS-mouse-over");
if(x.type==="mouseleave"){
d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}
}
);
k.data({
bindEvent_autoHideScrollbar:true}
)}
}
}
,scrollTo:function(e,f){
var i=c(this),o={
moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")}
,f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;
if(!k.hasClass("mCS_no_scrollbar")){
i.data({
mCS_trigger:f.trigger}
);
if(i.data("mCS_Init")){
f.callbacks=false}
if(e||e===0){
if(typeof(e)==="number"){
if(f.moveDragger){
p=e;
if(i.data("horizontalScroll")){
e=h.position().left*i.data("scrollAmount")}
else{
e=h.position().top*i.data("scrollAmount")}
draggerSpeed=0}
else{
p=e/i.data("scrollAmount")}
}
else{
if(typeof(e)==="string"){
var v;
if(e==="top"){
v=0}
else{
if(e==="bottom"&&!i.data("horizontalScroll")){
v=k.outerHeight()-g.height()}
else{
if(e==="left"){
v=0}
else{
if(e==="right"&&i.data("horizontalScroll")){
v=k.outerWidth()-g.width()}
else{
if(e==="first"){
v=i.find(".mCSB_container").find(":first")}
else{
if(e==="last"){
v=i.find(".mCSB_container").find(":last")}
else{
v=i.find(e)}
}
}
}
}
}
if(v.length===1){
if(i.data("horizontalScroll")){
e=v.position().left}
else{
e=v.position().top}
p=e/i.data("scrollAmount")}
else{
p=e=v}
}
}
if(i.data("horizontalScroll")){
if(i.data("onTotalScrollBack_Offset")){
s=-i.data("onTotalScrollBack_Offset")}
if(i.data("onTotalScroll_Offset")){
l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}
if(p<0){
p=e=0;
clearInterval(i.data("mCSB_buttonScrollLeft"));
if(!s){
q=true}
}
else{
if(p>=j.width()-h.width()){
p=j.width()-h.width();
e=g.width()-k.outerWidth();
clearInterval(i.data("mCSB_buttonScrollRight"));
if(!l){
m=true}
}
else{
e=-e}
}
var n=i.data("snapAmount");
if(n){
e=Math.round(e/n)*n-i.data("snapOffset")}
d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);
d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{
onStart:function(){
if(f.callbacks&&!i.data("mCS_tweenRunning")){
u("onScrollStart")}
if(i.data("autoHideScrollbar")){
d.showScrollbar.call(r)}
}
,onUpdate:function(){
if(f.callbacks){
u("whileScrolling")}
}
,onComplete:function(){
if(f.callbacks){
u("onScroll");
if(q||(s&&k.position().left>=s)){
u("onTotalScrollBack")}
if(m||(l&&k.position().left<=l)){
u("onTotalScroll")}
}
h.data("preventAction",false);
i.data("mCS_tweenRunning",false);
if(i.data("autoHideScrollbar")){
if(!g.hasClass("mCS-mouse-over")){
d.hideScrollbar.call(r)}
}
}
}
)}
else{
if(i.data("onTotalScrollBack_Offset")){
s=-i.data("onTotalScrollBack_Offset")}
if(i.data("onTotalScroll_Offset")){
l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}
if(p<0){
p=e=0;
clearInterval(i.data("mCSB_buttonScrollUp"));
if(!s){
q=true}
}
else{
if(p>=j.height()-h.height()){
p=j.height()-h.height();
e=g.height()-k.outerHeight();
clearInterval(i.data("mCSB_buttonScrollDown"));
if(!l){
m=true}
}
else{
e=-e}
}
var n=i.data("snapAmount");
if(n){
e=Math.round(e/n)*n-i.data("snapOffset")}
d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);
d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{
onStart:function(){
if(f.callbacks&&!i.data("mCS_tweenRunning")){
u("onScrollStart")}
if(i.data("autoHideScrollbar")){
d.showScrollbar.call(r)}
}
,onUpdate:function(){
if(f.callbacks){
u("whileScrolling")}
}
,onComplete:function(){
if(f.callbacks){
u("onScroll");
if(q||(s&&k.position().top>=s)){
u("onTotalScrollBack")}
if(m||(l&&k.position().top<=l)){
u("onTotalScroll")}
}
h.data("preventAction",false);
i.data("mCS_tweenRunning",false);
if(i.data("autoHideScrollbar")){
if(!g.hasClass("mCS-mouse-over")){
d.hideScrollbar.call(r)}
}
}
}
)}
if(i.data("mCS_Init")){
i.data({
mCS_Init:false}
)}
}
}
function u(w){
this.mcs={
top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))}
;
switch(w){
case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);
break;
case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);
break;
case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);
break;
case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);
break;
case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);
break}
}
}
,stop:function(){
var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");
d.mTweenAxisStop.call(this,e[0]);
d.mTweenAxisStop.call(this,f[0])}
,disable:function(e){
var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");
f.unbind("mousewheel focusin mouseenter mouseleave touchend");
h.unbind("touchstart touchmove");
if(e){
if(j.data("horizontalScroll")){
i.add(h).css("left",0)}
else{
i.add(h).css("top",0)}
}
g.css("display","none");
h.addClass("mCS_no_scrollbar");
j.data({
bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}
).addClass("mCS_disabled")}
,destroy:function(){
var e=c(this);
e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();
c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));
c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}
}
,d={
showScrollbar:function(){
this.stop().animate({
opacity:1}
,"fast")}
,hideScrollbar:function(){
this.stop().animate({
opacity:0}
,"fast")}
,mTweenAxis:function(g,i,h,f,o,y){
var y=y||{
}
,v=y.onStart||function(){
}
,p=y.onUpdate||function(){
}
,w=y.onComplete||function(){
}
;
var n=t(),l,j=0,r=g.offsetTop,s=g.style;
if(i==="left"){
r=g.offsetLeft}
var m=h-r;
q();
e();
function t(){
if(window.performance&&window.performance.now){
return window.performance.now()}
else{
if(window.performance&&window.performance.webkitNow){
return window.performance.webkitNow()}
else{
if(Date.now){
return Date.now()}
else{
return new Date().getTime()}
}
}
}
function x(){
if(!j){
v.call()}
j=t()-n;
u();
if(j>=g._time){
g._time=(j>g._time)?j+l-(j-g._time):j+l-1;
if(g._time<j+1){
g._time=j+1}
}
if(g._time<f){
g._id=_request(x)}
else{
w.call()}
}
function u(){
if(f>0){
g.currVal=k(g._time,r,m,f,o);
s[i]=Math.round(g.currVal)+"px"}
else{
s[i]=h+"px"}
p.call()}
function e(){
l=1000/60;
g._time=j+l;
_request=(!window.requestAnimationFrame)?function(z){
u();
return setTimeout(z,0.01)}
:window.requestAnimationFrame;
g._id=_request(x)}
function q(){
if(g._id==null){
return}
if(!window.requestAnimationFrame){
clearTimeout(g._id)}
else{
window.cancelAnimationFrame(g._id)}
g._id=null}
function k(B,A,F,E,C){
switch(C){
case"linear":return F*B/E+A;
break;
case"easeOutQuad":B/=E;
return -F*B*(B-2)+A;
break;
case"easeInOutQuad":B/=E/2;
if(B<1){
return F/2*B*B+A}
B--;
return -F/2*(B*(B-2)-1)+A;
break;
case"easeOutCubic":B/=E;
B--;
return F*(B*B*B+1)+A;
break;
case"easeOutQuart":B/=E;
B--;
return -F*(B*B*B*B-1)+A;
break;
case"easeOutQuint":B/=E;
B--;
return F*(B*B*B*B*B+1)+A;
break;
case"easeOutCirc":B/=E;
B--;
return F*Math.sqrt(1-B*B)+A;
break;
case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;
break;
case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;
break;
case"mcsEaseOut":var D=(B/=E)*B,z=D*B;
return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);
break;
case"draggerRailEase":B/=E/2;
if(B<1){
return F/2*B*B*B+A}
B-=2;
return F/2*(B*B*B+2)+A;
break}
}
}
,mTweenAxisStop:function(e){
if(e._id==null){
return}
if(!window.requestAnimationFrame){
clearTimeout(e._id)}
else{
window.cancelAnimationFrame(e._id)}
e._id=null}
,rafPolyfill:function(){
var f=["ms","moz","webkit","o"],e=f.length;
while(--e>-1&&!window.requestAnimationFrame){
window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];
window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}
}
}
;
d.rafPolyfill.call();
c.support.touch=!!("ontouchstart" in window);
c.support.msPointer=window.navigator.msPointerEnabled;
var a=("https:"==document.location.protocol)?"https:":"http:";
c.event.special.mousewheel||document.write('<script src="'+a+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');
c.fn.mCustomScrollbar=function(e){
if(b[e]){
return b[e].apply(this,Array.prototype.slice.call(arguments,1))}
else{
if(typeof e==="object"||!e){
return b.init.apply(this,arguments)}
else{
c.error("Method "+e+" does not exist")}
}
}
}
)(jQuery);
JS代码(jquery.newsWidget.min.js):
(function(A){
A.fn.newsWidget=function(G){
var e=A.extend({
currentNewsWidth:800,currentNewsHeight:280,numberOfNews:2,widgetHeight:540,fullArticleType:"widget",navBtns:"sides",closedNewsWidth:500,closedNewsPosition:"left",closedNewsOffset:50,maxLetters:330,imgCrop:true,imgHeight:200,widgetOpenType:"fadeDown",widgetOpenDelay:0.5,widgetOpenDuration:0.5,fullArticleOpen:"fadeLeft",fullArticleClose:"fadeRight",fullArticleOpenDelay:0.1,fullArticleAnimationDuration:0.5,animationsDuration:0.4,easeing:"Expo.easeOut",currentNewsHoverType:1,linkText:"Read:",titleInLink:"after",linkTarget:"blank",readMoreTxt:"Continue Reading ..",feed:"none",feedReadMoreType:"insite",feedMaxNum:10}
,G);
var i=0;
var d=0;
var E;
var b=1;
var L=1;
var U=new Array();
var c=0;
var W=A(this);
var N;
var P;
var K;
var Z;
if(e.feed==="none"||e.feed===""||e.feed===undefined||e.feed==="undefined"){
var Q=A(this).html();
A(this).empty();
A(this).append('<div class="newsWidgetData">'+Q+"</div>");
R();
I()}
else{
R();
jQuery.getFeed({
url:"proxy.php?url="+e.feed,success:H}
)}
function H(p){
var l="";
for(var k=0;
k<p.items.length&&k<e.feedMaxNum;
k++){
var n=p.items[k];
var q=n.updated;
var j=n.updated;
var r=n.updated;
q=(q.slice(8,10));
if(q.slice(0,1)==="0"){
q=(q.slice(1,2))}
j=(j.slice(5,7));
if(j.slice(0,1)==="0"){
j=(j.slice(1,2))}
var o=q+"-"+j+"-"+r.slice(0,4);
l+='<li class="widgetdata" data-title="'+n.title+'" data-date="'+o+'" ';
if(e.feedReadMoreType==="external"){
l+='data-link="'+n.link+'"'}
l+=">";
l+=n.description+'<a class="readmore" href="'+n.link+'" target="blank">'+e.readMoreTxt+"</a>";
l+="</li>"}
W.append('<div class="newsWidgetData">'+l+"</div>");
I()}
function R(){
var k="<!-- ---- NEWS WIDGET GENERATED HTML --- -->";
k+='<div class="newsWidgetLoading"></div>';
k+='<div class="newsWidget">';
if(e.navBtns!=="bottom-left"&&e.navBtns!=="bottom-right"){
k+='<nav class="left"></nav>'}
k+='<div class="newsCnt">';
k+='<header style="height:'+e.currentNewsHeight+'px"><div class="newsWidgetCnt"></div></header>';
k+="</div>";
if(e.navBtns==="sides"||e.navBtns==="bottom-left"||e.navBtns==="bottom-right"||e.navBtns==="top/bottom"){
k+='<nav class="right"></nav>'}
k+="</div>";
k+="<!-- END GENERATED CONTENT -->";
W.append(k);
var j=A('<article class="closed"></article>').hide().appendTo(W);
E=parseInt(j.height(),10);
b=parseInt(j.css("margin-top"),10);
L=parseInt(j.css("margin-bottom"),10);
j.remove();
if(e.numberOfNews<1){
e.numberOfNews=parseInt(((e.widgetHeight-e.currentNewsHeight)/2)/E,10)}
e.widgetHeight=e.currentNewsHeight+2*e.numberOfNews*(E+b+L)-3*(b+L);
W.css("overflow","hidden");
W.css("width",e.currentNewsWidth);
W.css("height",e.widgetHeight);
W.find(".newsWidget .newsCnt").css("width",e.currentNewsWidth);
W.find(".newsWidget .newsCnt").css("height",e.widgetHeight);
W.find(".newsWidget .newsCnt header").css("margin-top",Math.round((e.widgetHeight-e.currentNewsHeight)/2));
switch(e.navBtns){
case"sides":W.find(".newsWidget nav").height(e.widgetHeight);
W.find(".newsWidget nav.left").css("float","left");
W.find(".newsWidget nav.right").css("float","right");
W.find(".newsWidget .newsCnt").css("float","left");
W.find(".newsWidget nav.left").html('<div class="newsWidgetCnt"><a class="button prev" href="#"><span>Up</span></a></div>');
W.find(".newsWidget nav.right").html('<div class="newsWidgetCnt"><a class="button next" href="#"><span>Down</span></a></div>');
W.find(".newsWidget nav .newsWidgetCnt").css("margin-top","-30px");
i=e.currentNewsWidth+2*parseInt(W.find(".newsWidget nav").width(),10);
d=e.widgetHeight;
break;
case"left":W.find(".newsWidget nav").height(e.widgetHeight);
W.find(".newsWidget nav").css("float","left");
W.find(".newsWidget .newsCnt").css("float","right");
i=e.currentNewsWidth+parseInt(W.find(".newsWidget nav").width(),10);
d=e.widgetHeight;
W.find(".newsWidget nav").html('<div class="newsWidgetCnt"><a class="button up" href="#"><span>Up</span></a><a class="button down" href="#"><span>Down</span></a></div>');
break;
case"right":W.find(".newsWidget nav").height(e.widgetHeight);
W.find(".newsWidget nav").css("float","right");
W.find(".newsWidget .newsCnt").css("float","left");
i=e.currentNewsWidth+parseInt(W.find(".newsWidget nav").width(),10);
d=e.widgetHeight;
W.find(".newsWidget nav").html('<div class="newsWidgetCnt"><a class="button up" href="#"><span>Up</span></a><a class="button down" href="#"><span>Down</span></a></div>');
break;
case"top-left":case"top-right":i=e.currentNewsWidth;
d=e.widgetHeight+parseInt(W.find(".newsWidget nav").height(),10);
W.find(".newsWidget nav").width(e.currentNewsWidth);
if(e.navBtns==="top-left"){
W.find(".newsWidget nav").html('<div class="newsWidgetCnt"><a class="button prev" style="float:left" href="#"><span>Up</span></a><a class="button next" style="float:left" href="#"><span>Down</span></a></div>')}
else{
W.find(".newsWidget nav").html('<div class="newsWidgetCnt"><a class="button next" style="float:right" href="#"><span>Down</span></a><a class="button prev" style="float:right" href="#"><span>Up</span></a></div>')}
W.find(".newsWidget nav .newsWidgetCnt").css("margin-top","0px");
W.find(".newsWidget nav .newsWidgetCnt").css("top","0px");
break;
case"bottom-left":case"bottom-right":W.find(".newsWidget nav.right").width(e.currentNewsWidth);
W.find(".newsWidget nav.right").css("position","absolute");
W.find(".newsWidget nav.right").css("bottom","0px");
if(e.navBtns==="bottom-left"){
W.find(".newsWidget nav.right").html('<div class="newsWidgetCnt"><a class="button prev" style="float:left" href="#"><span>Up</span></a><a class="button next" style="float:left" href="#"><span>Down</span></a></div>')}
else{
W.find(".newsWidget nav.right").html('<div class="newsWidgetCnt"><a class="button next" style="float:right" href="#"><span>Down</span></a><a class="button prev" style="float:right" href="#"><span>Up</span></a></div>')}
W.find(".newsWidget nav.right .newsWidgetCnt").css("margin-top","0px");
W.find(".newsWidget nav.right .newsWidgetCnt").css("top","0px");
i=e.currentNewsWidth;
d=e.widgetHeight+parseInt(W.find(".newsWidget nav").height(),10);
break;
case"top/bottom":W.find(".newsWidget nav").width(e.currentNewsWidth);
W.find(".newsWidget nav.right").css("position","absolute");
W.find(".newsWidget nav.left").html('<div class="newsWidgetCnt"><a class="button up" style="float:left;
" href="#"><span>Up</span></a></div>');
W.find(".newsWidget nav.right").html('<div class="newsWidgetCnt"><a class="button down" style="float:left;
" href="#"><span>Down</span></a></div>');
W.find(".newsWidget nav .newsWidgetCnt").css("margin-top","0px");
W.find(".newsWidget nav .newsWidgetCnt").css("top","0px");
W.find(".newsWidget nav a").css("width",e.closedNewsWidth);
if(e.closedNewsPosition==="left"){
W.find(".newsWidget nav a").css("margin-left",e.closedNewsOffset)}
else{
if(e.closedNewsPosition==="right"){
W.find(".newsWidget nav a").css("margin-left",(e.currentNewsWidth-e.closedNewsWidth)+e.closedNewsOffset)}
}
i=e.currentNewsWidth;
d=e.widgetHeight+2*parseInt(W.find(".newsWidget nav").height(),10);
break}
W.css("width",i);
W.css("height",d);
W.find(".newsWidget").css("width",i);
W.find(".newsWidget").css("height",d)}
function I(){
W.find(".newsWidgetData> li").not("li li").each(function(r,s){
P=U.length;
N=new V(this,P);
U.push(N)}
);
var k;
for(var n=0;
n<U.length;
n++){
var o=e.linkText;
var m=e.titleInLink;
if(A(U[n].ref).attr("data-link-text")!==undefined&&A(U[n].ref).attr("data-link-text")!=="undefined"&&A(U[n].ref).attr("data-link-text")!==""){
o=A(U[n].ref).attr("data-link-text")}
if(A(U[n].ref).attr("data-title-in-link")!==undefined&&A(U[n].ref).attr("data-title-in-link")!=="undefined"&&A(U[n].ref).attr("data-title-in-link")!==""){
m=A(U[n].ref).attr("data-title-in-link")}
k=A(U[n].ref).attr("data-link");
var l='<article class="news-'+n+'" data-id="'+n+'"><blockquote cite=""><h2>'+A(U[n].ref).attr("data-title")+"</h2><time>"+f(U[n].ref)+'</time><div class="excerpt">'+S(A(U[n].ref).text())+"</div>";
if(k!=="undefined"&&k!==false&&k!==""&&k!==undefined&&A(U[n].ref).attr("data-link-type")!=="readmore"){
l+='<a class="link" href="'+k+'" target="'+e.linkTarget+'">'}
else{
l+='<a class="link insite-read" data-id="'+n+'" href="#"">'}
if(A(U[n].ref).attr("data-link-type")==="readmore"){
A(U[n].ref).append('<a class="readmore" href="'+A(U[n].ref).attr("data-link")+'" target="blank">'+e.readMoreTxt+"</a>")}
switch(m){
case"before":l+=A(U[n].ref).attr("data-title")+o+"</a></blockquote>";
break;
case"after":l+=o+A(U[n].ref).attr("data-title")+"</a></blockquote>";
break;
case"none":l+=o+"</a></blockquote>";
break;
default:l+=o+"</a></blockquote>";
break}
l+="<aside><mark>"+A(U[n].ref).attr("data-title")+'</mark><time datetime="'+f(A(U[n].ref))+'"><strong>'+J(U[n].ref)+"</strong><em>"+X(U[n].ref)+"</em></time></aside></article>";
W.find(".newsWidget .newsCnt").append(l);
W.find(".newsWidget .newsCnt header .newsWidgetCnt").append(l);
W.find(".newsWidget .newsCnt article img").remove()}
W.find(".newsWidget .newsCnt article").addClass("closed");
W.find(".newsWidget .newsCnt header article").removeClass("closed");
W.find(".newsWidget .newsCnt header article").addClass("current");
W.find(".closed").css("width",e.closedNewsWidth);
if(e.closedNewsPosition==="left"){
W.find(".closed").css("margin-left",e.closedNewsOffset)}
else{
if(e.closedNewsPosition==="right"){
W.find(".closed").css("margin-left",(e.currentNewsWidth-e.closedNewsWidth)-e.closedNewsOffset)}
}
var p=W.find(".newsWidget .newsCnt article.closed aside time").width()+1;
var q=W.find(".newsWidget .newsCnt article.closed aside time").height()+1;
W.find(".newsWidget .newsCnt article.closed").hover(function(r){
TweenMax.to(A(this).find("time"),e.animationsDuration,{
css:{
left:-p}
,ease:e.easeing}
);
TweenMax.to(A(this).find("mark"),e.animationsDuration,{
css:{
marginLeft:p+10}
,ease:e.easeing}
);
TweenMax.to(A(this),e.animationsDuration,{
css:{
backgroundPosition:(p+10)+"px "+q/3+"px"}
,ease:e.easeing,delay:(e.animationsDuration-0.1)}
)}
,function(r){
TweenMax.to(A(this).find("time"),e.animationsDuration,{
css:{
left:"0px"}
,ease:e.easeing,delay:(e.animationsDuration-0.1)}
);
TweenMax.to(A(this).find("mark"),e.animationsDuration,{
css:{
marginLeft:p}
,ease:e.easeing}
);
TweenMax.killTweensOf(A(this));
TweenMax.to(A(this),e.animationsDuration,{
css:{
backgroundPosition:"-30px 20px"}
,ease:e.easeing}
)}
);
if(e.currentNewsHoverType==2){
var j=W.find(".newsWidget .newsCnt header article").css("background-color");
W.find(".newsWidget .newsCnt header article").css("cursor","pointer")}
W.find(".newsWidget .newsCnt header article").hover(function(){
switch(e.currentNewsHoverType){
case 1:var r=A(this).find("a.link");
TweenMax.to(r,e.animationsDuration,{
css:{
bottom:"0px"}
,ease:e.easeing}
);
TweenMax.fromTo(r,(e.animationsDuration+0.1),{
css:{
textIndent:"-500px",backgroundPosition:"-100% center"}
}
,{
css:{
textIndent:"50px",backgroundPosition:"25px center"}
,ease:e.easeing,delay:0.08}
);
break;
case 2:TweenMax.to(A(this),e.animationsDuration,{
css:{
backgroundColor:A(this).find("a.link").css("background-color")}
,ease:e.easeing}
);
TweenMax.to(A(this).find("a.link"),0,{
css:{
bottom:"0px"}
,ease:e.easeing,delay:e.animationsDuration}
);
TweenMax.fromTo(A(this).find("a.link"),(e.animationsDuration-0.1),{
css:{
textIndent:"-500px",backgroundPosition:"-100% center"}
}
,{
css:{
textIndent:"50px",backgroundPosition:"25px center"}
,ease:e.easeing,delay:e.animationsDuration}
);
break}
}
,function(){
switch(e.currentNewsHoverType){
case 1:TweenMax.to(A(this).find("a.link"),e.animationsDuration,{
css:{
bottom:"-60px"}
,ease:e.easeing}
);
break;
case 2:TweenMax.to(A(this),e.animationsDuration,{
css:{
backgroundColor:j}
,ease:e.easeing}
);
TweenMax.to(A(this).find("a.link"),e.animationsDuration,{
css:{
bottom:"-60px"}
,ease:e.easeing}
);
break}
}
);
W.find("a.insite-read").click(function(r){
r.preventDefault();
T(W,A(this).attr("data-id"));
return false}
);
W.find(".next,.up").click(function(r){
r.preventDefault();
if(c<U.length){
F(W)}
return false}
);
W.find(".prev,.down").click(function(r){
r.preventDefault();
if(c>1){
D(W)}
return false}
);
W.find(".newsWidget .newsCnt article.closed").click(function(r){
r.preventDefault();
a(W,A(this).attr("data-id"));
return false}
);
F(W);
W.find(".newsWidgetData").remove();
TweenMax.to(W.find(".newsWidgetLoading"),e.animationsDuration,{
css:{
opacity:0}
,ease:e.easeing,onComplete:function(){
W.find(".newsWidgetLoading").remove()}
}
);
TweenMax.to(W,e.animationsDuration,{
css:{
opacity:1}
,ease:e.easeing}
);
switch(e.widgetOpenType){
case"fade":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
break;
case"fadeUp":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginTop:d}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing,delay:e.widgetOpenDelay+0.2}
);
break;
case"fadeLeft":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginLeft:-i}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing,delay:e.widgetOpenDelay+0.2}
);
break;
case"fadeRight":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginLeft:i}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing,delay:e.widgetOpenDelay+0.2}
);
break;
case"fadeDown":TweenMax.fromTo(W.find(".newsWidget"),e.animationsDuration,{
css:{
marginTop:-d}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing,delay:e.widgetOpenDelay+0.2}
);
break;
case"slideUp":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginTop:d}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
break;
case"slideLeft":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginLeft:-i}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
break;
case"slideRight":TweenMax.fromTo(W.find(".newsWidget"),e.widgetOpenDuration,{
css:{
marginLeft:i}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
break;
case"slideDown":TweenMax.fromTo(W.find(".newsWidget"),e.animationsDuration,{
css:{
marginTop:-d}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.widgetOpenDelay}
);
break}
}
function a(m,n){
var j=parseInt(n,10)+1;
if(j===U.length){
TweenMax.to(m.find(".next,.up"),e.animationsDuration,{
css:{
opacity:0.5}
,ease:e.easeing}
);
m.find(".next,.up").css("cursor","default")}
else{
TweenMax.to(m.find(".next,.up"),e.animationsDuration,{
css:{
opacity:1}
,ease:e.easeing}
);
m.find(".next,.up").css("cursor","pointer")}
if(j===1){
TweenMax.to(m.find(".prev,.down"),e.animationsDuration,{
css:{
opacity:0.5}
,ease:e.easeing}
);
m.find(".prev,.down").css("cursor","default")}
else{
TweenMax.to(m.find(".prev,.down"),e.animationsDuration,{
css:{
opacity:1}
,ease:e.easeing}
);
m.find(".prev,.down").css("cursor","pointer")}
var k=-(e.currentNewsHeight+(j-1)*(E+L));
TweenMax.killTweensOf(m.find(".news-0.closed"));
TweenMax.to(m.find(".news-0.closed"),(e.animationsDuration+0.2),{
css:{
marginTop:k}
,ease:e.easeing}
);
if((c+1)!==1){
m.find(".news-"+c+".closed").css("margin-top",b)}
m.find(".news-"+(j)+".closed").css("margin-top",(e.currentNewsHeight-E-b));
c=parseInt(n,10)+1;
var l=-(c-1)*m.find(".newsWidget .newsCnt header").height();
TweenMax.to(m.find(".newsWidget .newsCnt header .newsWidgetCnt"),(e.animationsDuration+0.5),{
css:{
marginTop:l}
,ease:e.easeing}
)}
function F(l){
c+=1;
if(c===U.length){
TweenMax.to(l.find(".next,.up"),e.animationsDuration,{
css:{
opacity:0.5}
,ease:e.easeing}
);
l.find(".next,.up").css("cursor","default")}
if(c>1){
TweenMax.to(l.find(".prev,.down"),e.animationsDuration,{
css:{
opacity:1}
,ease:e.easeing}
);
l.find(".prev,.down").css("cursor","pointer")}
else{
TweenMax.to(l.find(".prev,.down"),e.animationsDuration,{
css:{
opacity:0.5}
,ease:e.easeing}
);
l.find(".prev,.down").css("cursor","default")}
var j=-(e.currentNewsHeight+(c-1)*(E+L));
TweenMax.killTweensOf(l.find(".news-0.closed"));
TweenMax.to(l.find(".news-0.closed"),e.animationsDuration,{
css:{
marginTop:j}
,ease:e.easeing}
);
if(c!==1){
l.find(".news-"+(c-1)+".closed").css("margin-top",b)}
l.find(".news-"+(c)+".closed").css("margin-top",(e.currentNewsHeight-E));
var k=-(c-1)*l.find(".newsWidget .newsCnt header").height();
TweenMax.killTweensOf(l.find(".newsWidget .newsCnt header .newsWidgetCnt"));
TweenMax.to(l.find(".newsWidget .newsCnt header .newsWidgetCnt"),0.5,{
css:{
marginTop:k}
,ease:e.easeing}
)}
function D(l){
c-=1;
if(c===1){
TweenMax.to(l.find(".prev,.down"),e.animationsDuration,{
css:{
opacity:0.5}
,ease:e.easeing}
);
l.find(".prev,.down").css("cursor","default")}
TweenMax.to(l.find(".next,.up"),e.animationsDuration,{
css:{
opacity:1}
,ease:e.easeing}
);
l.find(".next,.up").css("cursor","pointer");
var j=-(e.currentNewsHeight+(c-1)*(E+L));
TweenMax.killTweensOf(l.find(".news-0.closed"));
TweenMax.to(l.find(".news-0.closed"),e.animationsDuration,{
css:{
marginTop:j}
,ease:e.easeing}
);
l.find(".news-"+(c+1)+".closed").css("margin-top",b);
l.find(".news-"+(c)+".closed").css("margin-top",(e.currentNewsHeight-E));
var k=-(c-1)*l.find(".newsWidget .newsCnt header").height();
TweenMax.killTweensOf(l.find(".newsWidget .newsCnt header .newsWidgetCnt"));
TweenMax.to(l.find(".newsWidget .newsCnt header .newsWidgetCnt"),0.5,{
css:{
marginTop:k}
,ease:e.easeing}
)}
function T(m,n){
switch(e.fullArticleType){
case"full":A("body").append('<section id="fullNewsReader"><div class="newsWidgetCnt"><header><a class="button exit fullpage" href="#"><span>Close</span></a></header></div></section>');
A("#fullNewsReader header").append("<mark></mark><time></time>");
A("#fullNewsReader mark").html(A(U[n].ref).attr("data-title"));
A("#fullNewsReader time").html(f(A(U[n].ref)));
A("#fullNewsReader .newsWidgetCnt").append('<article><div class="wrapper"><div class="imgHolder"></div></div></article>');
A("#fullNewsReader article .wrapper").append('<div class="news">'+A(U[n].ref).html()+"</div>");
Z=A("body").css("overflow");
A("body").css("overflow","hidden");
var k=A(window).height()-A("#fullNewsReader article").position().top;
A("#fullNewsReader article").height(k);
if(k>(A("#fullNewsReader article .news").height()+parseInt(A("#fullNewsReader article .news").css("padding-top"),10)+parseInt(A("#fullNewsReader article .news").css("padding-bottom"),10))){
A("#fullNewsReader article .news").height(k-parseInt(A("#fullNewsReader article .news").css("padding-top"),10)-parseInt(A("#fullNewsReader article .news").css("padding-bottom"),10))}
O(A("#fullNewsReader"),n);
A("#fullNewsReader article").mCustomScrollbar();
TweenMax.fromTo(A("#fullNewsReader"),e.fullArticleAnimationDuration,{
css:{
opacity:0}
}
,{
css:{
opacity:1}
,ease:e.easeing}
);
A("#fullNewsReader a.button.exit").click(function(o){
o.preventDefault();
g()}
);
switch(e.fullArticleOpen){
case"fadeUp":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:A("#fullNewsReader").height(),opacity:0}
}
,{
css:{
marginTop:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeLeft":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A("#fullNewsReader").width(),opacity:0}
}
,{
css:{
marginLeft:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeRight":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A("#fullNewsReader").width(),opacity:0}
}
,{
css:{
marginLeft:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeDown":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:-A("#fullNewsReader").height(),opacity:0}
}
,{
css:{
marginTop:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideUp":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:A("#fullNewsReader").height()}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideLeft":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A("#fullNewsReader").width()}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideRight":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A("#fullNewsReader").width()}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideDown":TweenMax.fromTo(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:-A("#fullNewsReader").height()}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break}
break;
case"widget":m.append('<section class="widgetNewsReader"><header><a class="button exit widget" href="#"><span>Close</span></a></header></section>');
m.find(".widgetNewsReader header").append("<mark></mark><time></time>");
m.find(".widgetNewsReader").width(i);
m.find(".widgetNewsReader").height(d);
var j=i-parseInt(m.find(".widgetNewsReader a.button.exit.widget").width(),10);
m.find(".widgetNewsReader header").width(j);
m.find(".widgetNewsReader header mark").html(A(U[n].ref).attr("data-title"));
m.find(".widgetNewsReader header time").html(f(A(U[n].ref)));
m.find(".widgetNewsReader").append('<article><div class="imgHolder"></div></article>');
m.find(".widgetNewsReader article").append('<div class="news">'+A(U[n].ref).html()+"</div>");
m.find(".widgetNewsReader article").width(j+16);
m.find(".widgetNewsReader article .news").width(j-80);
var l=d-m.find(".widgetNewsReader article").position().top;
m.find(".widgetNewsReader article").height(l);
if(l>(m.find(".widgetNewsReaderarticle .news").height()+parseInt(A("#fullNewsReader article .news").css("padding-top"),10)+parseInt(m.find(".widgetNewsReader article .news").css("padding-bottom"),10))){
m.find(".widgetNewsReader article .news").height(l-parseInt(m.find(".widgetNewsReader article .news").css("padding-top"),10)-parseInt(m.find(".widgetNewsReader article .news").css("padding-bottom"),10))}
O(A(".widgetNewsReader"),n);
m.find(".widgetNewsReader article").mCustomScrollbar();
m.find("a.button.exit").click(function(o){
o.preventDefault();
g()}
);
switch(e.fullArticleOpen){
case"fadeUp":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:m.find(".widgetNewsReader").height(),opacity:0}
}
,{
css:{
marginTop:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginTop:-m.find(".widgetNewsReader").height(),opacity:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeLeft":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-m.find(".widgetNewsReader").width(),opacity:0}
}
,{
css:{
marginLeft:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:m.find(".widgetNewsReader").width(),opacity:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeRight":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:m.find(".widgetNewsReader").width(),opacity:0}
}
,{
css:{
marginLeft:0,opacity:1}
,ease:e.easeing}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-m.find(".widgetNewsReader").width(),opacity:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"fadeDown":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:-m.find(".widgetNewsReader").height(),opacity:0}
}
,{
css:{
marginTop:0,opacity:1}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginTop:m.find(".widgetNewsReader").height(),opacity:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideUp":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:m.find(".widgetNewsReader").height()}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginTop:-m.find(".widgetNewsReader").height()}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideLeft":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-m.find(".widgetNewsReader").width()}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:m.find(".widgetNewsReader").width()}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideRight":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:m.find(".widgetNewsReader").width()}
}
,{
css:{
marginLeft:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-m.find(".widgetNewsReader").width()}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break;
case"slideDown":TweenMax.fromTo(m.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:-m.find(".widgetNewsReader").height()}
}
,{
css:{
marginTop:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
TweenMax.to(m.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginTop:m.find(".widgetNewsReader").height(),opacity:0}
,ease:e.easeing,delay:e.fullArticleOpenDelay}
);
break}
break}
}
function h(){
A("#fullNewsReader article").mCustomScrollbar("destroy");
A("#fullNewsReader").remove();
A("body").css("overflow",Z)}
function B(){
A(".widgetNewsReader article").mCustomScrollbar("destroy");
A(".widgetNewsReader").remove()}
function g(){
switch(e.fullArticleType){
case"full":TweenMax.fromTo(A("#fullNewsReader"),e.fullArticleAnimationDuration,{
css:{
opacity:1}
}
,{
css:{
opacity:0}
,ease:e.easeing,onComplete:h}
);
switch(e.fullArticleClose){
case"fadeUp":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:-A("#fullNewsReader").height(),opacity:0}
,ease:e.easeing}
);
break;
case"fadeLeft":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A("#fullNewsReader").width(),opacity:0}
,ease:e.easeing}
);
break;
case"fadeRight":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A("#fullNewsReader").width(),opacity:0}
,ease:e.easeing}
);
break;
case"fadeDown":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:A("#fullNewsReader").height(),opacity:0}
,ease:e.easeing}
);
break;
case"slideUp":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A("#fullNewsReader .newsWidgetCnt").height()}
,ease:e.easeing}
);
break;
case"slideLeft":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A("#fullNewsReader").width()}
,ease:e.easeing}
);
break;
case"slideRight":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A("#fullNewsReader").width()}
,ease:e.easeing}
);
break;
case"slideDown":TweenMax.to(A("#fullNewsReader .newsWidgetCnt"),e.fullArticleAnimationDuration,{
css:{
marginTop:A("#fullNewsReader").height()}
,ease:e.easeing}
);
break}
break;
case"widget":switch(e.fullArticleClose){
case"fadeUp":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:-A(".widgetNewsReader").height(),opacity:0}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:0,marginTop:d,opacity:0}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"fadeLeft":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A(window).width(),opacity:0}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:i,marginTop:0,opacity:0}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"fadeRight":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A(window).width(),opacity:0}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-i,marginTop:0,opacity:0}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"fadeDown":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:A(".widgetNewsReader").height(),opacity:0}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:0,marginTop:-d,opacity:0}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"slideUp":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A(".widgetNewsReader").height()}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:0,marginTop:d,opacity:1}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"slideLeft":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-A(window).width()}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:d,marginTop:0,opacity:1}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"slideRight":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginLeft:A(window).width()}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:-d,marginTop:0,opacity:1}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break;
case"slideDown":TweenMax.to(W.find(".widgetNewsReader"),e.fullArticleAnimationDuration,{
css:{
marginTop:A(".widgetNewsReader").height()}
,ease:e.easeing}
);
TweenMax.fromTo(W.find(".newsWidget"),e.fullArticleAnimationDuration,{
css:{
marginLeft:0,marginTop:-d,opacity:1}
}
,{
css:{
margin:0,opacity:1}
,ease:e.easeing,onComplete:B}
);
break}
break}
}
function O(j,o){
var k=A(window).height()-j.find("article").position().top;
var l=A(U[o].ref).attr("data-image");
if(l!=="undefined"&&l!==""&&l!==undefined){
var m=e.imgCrop;
var n=e.imgHeight;
if(A(U[o].ref).attr("data-image-cropping")==="false"){
m=false}
if(A(U[o].ref).attr("data-image-cropping")==="true"){
m=true}
if(A(U[o].ref).attr("data-image-height")!==undefined&&A(U[o].ref).attr("data-image-height")!=="undefined"&&A(U[o].ref).attr("data-image-height")!==""){
n=A(U[o].ref).attr("data-image-height")}
j.find(".imgHolder").append('<img src="'+l+'" />');
j.find(".imgHolder img").css("display","none");
j.find(".imgHolder img").load(function(q){
if(m){
var r=j.find(".imgHolder img").height()-n;
var p=i-parseInt(W.find(".widgetNewsReader a.button.exit.widget").width(),10);
W.find(".widgetNewsReader .imgHolder img").width(p);
if(r>0){
j.find(".imgHolder img").css("display","block");
TweenMax.fromTo(j.find(".imgHolder"),e.animationsDuration,{
css:{
height:0}
}
,{
css:{
height:n}
,ease:e.easeing,onComplete:M,onCompleteScope:j}
);
j.find(".imgHolder img").css("margin-top",-parseInt(r/2,10));
j.find(".imgHolder").addClass("expandImg");
j.find(".imgHolder.expandImg").click(function(s){
if(parseInt(A(this).find("img").css("margin-top"),10)<0){
TweenMax.to(A(this).find("img"),e.animationsDuration,{
css:{
marginTop:0}
,ease:e.easeing}
);
TweenMax.to(A(this),e.animationsDuration,{
css:{
height:A(this).find("img").height()}
,ease:e.easeing}
)}
else{
var t=A(this).find("img").height()-n;
TweenMax.to(A(this).find(" img"),e.animationsDuration,{
css:{
marginTop:-parseInt(t/2,10)}
,ease:e.easeing}
);
TweenMax.to(A(this),e.animationsDuration,{
css:{
height:n}
,ease:e.easeing}
)}
}
)}
else{
j.find(".imgHolder img").css("display","block");
TweenMax.fromTo(j.find(".imgHolder"),e.animationsDuration,{
css:{
height:0}
}
,{
css:{
height:n}
,ease:e.easeing,onComplete:M,onCompleteScope:j}
)}
}
if(k-j.find(".imgHolder").height()>(j.find(".news").height()-parseInt(j.find(".news").css("margin-top"),10))){
j.find(".news").height(k-j.find(".imgHolder").height()-parseInt(j.find("article .news").css("padding-top"),10)-parseInt(j.find("article .news").css("padding-bottom"),10)-parseInt(j.find(" article .news").css("margin-top"),10))}
}
)}
else{
}
}
function M(){
this.find("article").mCustomScrollbar("update")}
function S(j){
var k=A("<div>"+j+"</div>");
k.find("*").contents().unwrap();
var l=k.html().substr(0,e.maxLetters);
if(j.length>e.maxLetters){
l+=" [...]"}
return l}
function C(k){
var j=(k)%100;
return j>3&&j<21?"th":["th","st","nd","rd"][j%10]||"th"}
function J(j){
var k=A(j).attr("data-date").split("-");
return k[0]}
function X(k){
var l=A(k).attr("data-date").split("-");
var j=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec"];
return j[l[1]]}
function f(l){
var m=A(l).attr("data-date").split("-");
var k=["January","February","March","April","May","June","July","August","September","October","November","December"];
var j=k[m[1]]+" "+m[0]+C(m[0])+","+m[2];
if(A(l).hasOwnProperty("data-time")){
j+=" - "+A(l).attr("data-time")}
return j}
function V(j,k){
this.ref=j;
this.id=k}
function Y(j){
A(".trace").append("<< "+j+" >>")}
}
}
(jQuery));
CSS代码(newsWidget_color.css):