$(function () { $(".weixin img").hide(); $(".weixin").hover(function () { $(this).find("img").fadeIn(); }, function () { $(this).find("img").fadeOut(); }); }) $(function () { $("#kinMaxShow").kinMaxShow({ height:757, button: { normal: { right: '47%', borderRadius: '10px', background: "#ffffff", border: "0" }, focus: { borderRadius: '10px', background: "#1392fd", border: "1px", color: "#1392fd" } } }); }) $(function(jQuery){ $.fn.BreakingNews = function(settings){ var defaults={ background :'#333', title :'NEWS', titlecolor :'#FFF', titlebgcolor :'#5aa628', linkcolor :'#ccc', linkhovercolor :'#5aa628', fonttextsize :16, isbold :false, border :'none', width :'100%', autoplay :true, timer :3000, modulid :'brekingnews', effect :'fade' //or slide }; var settings=$.extend(defaults,settings); return this.each(function(){ settings.modulid="#"+$(this).attr("id"); var timername=settings.modulid; var activenewsid=1; if (settings.isbold==true) fontw='bold'; else fontw='normal'; if (settings.effect=='slide') $(settings.modulid+' ul li').css({'display':'block'}); else $(settings.modulid+' ul li').css({'display':'none'}); $(settings.modulid+' .bn-title').html(settings.title); $(settings.modulid).css({'width':settings.width, 'background':settings.background, 'border':settings.border, 'font-size':settings.fonttextsize }); $(settings.modulid+' ul').css({'left':$(settings.modulid+' .bn-title').width()+10}); $(settings.modulid+' .bn-title').css({'background':settings.titlebgcolor,'color':settings.titlecolor,'font-weight':fontw}); $(settings.modulid+' ul li a').css({'color':settings.linkcolor,'font-weight':fontw,'height':parseInt(settings.fonttextsize)+6}); $(settings.modulid+' ul li').eq( parseInt(activenewsid-1) ).css({'display':'block'}); // Links hover events ...... $(settings.modulid+' ul li a').hover(function() { $(this).css({'color':settings.linkhovercolor}); }, function () { $(this).css({'color':settings.linkcolor}); } ); // Arrows Click Events ...... $(settings.modulid+' .bn-arrows span').click(function(e) { if ( $(this).attr('class')=="bn-arrows-left" ) BnAutoPlay('prev'); else BnAutoPlay('next'); }); // Timer events ............... if (settings.autoplay==true) { timername=setInterval(function(){BnAutoPlay('next')},settings.timer); $(settings.modulid).hover(function() { clearInterval(timername); }, function() { timername=setInterval(function(){BnAutoPlay('next')},settings.timer); } ); } else { clearInterval(timername); } //timer and click events function ........... function BnAutoPlay(pos) { if ( pos=="next" ) { if ( $(settings.modulid+' ul li').length>activenewsid ) activenewsid++; else activenewsid=1; } else { if (activenewsid-2==-1) activenewsid=$(settings.modulid+' ul li').length; else activenewsid=activenewsid-1; } if (settings.effect=='fade') { $(settings.modulid+' ul li').css({'display':'none'}); $(settings.modulid+' ul li').eq( parseInt(activenewsid-1) ).fadeIn(); } else { $(settings.modulid+' ul').animate({'marginTop':-($(settings.modulid+' ul li').height()+40)*(activenewsid-1)}); } } // links size calgulating function ........... $(window).resize(function(e) { if ( $(settings.modulid).width()<360 ) { $(settings.modulid+' .bn-title').html(' '); $(settings.modulid+' .bn-title').css({ 'width':'4px'}); $(settings.modulid+' ul').css({'left':4}); }else { $(settings.modulid+' .bn-title').html(settings.title); $(settings.modulid+' .bn-title').css({ 'width':'auto'}); $(settings.modulid+' ul').css({'left':$(settings.modulid+' .bn-title').width()+40}); } }); }); }; }); /* * Lightcase - jQuery Plugin * @version 1.5.4 (02/11/2014) */ ;(function ($) { window.lightcase = { cache : {}, support : {}, labels : { 'errorMessage' : 'Source could not be found...', 'sequenceInfo.of' : ' of ', 'close' : 'Close', 'navigator.prev' : 'Prev', 'navigator.next' : 'Next', 'navigator.play' : 'Play', 'navigator.pause' : 'Pause' }, /** * Initializes the plugin * * @param {object} options * @return {object} */ init : function (options) { return this.each(function () { $(this).unbind('click').click(function (event) { event.preventDefault(); $(this).lightcase('start', options); }); }); }, /** * Starts the plugin * * @param {object} options * @return {void} */ start : function (options) { lightcase.settings = $.extend({ idPrefix : 'lightcase-', classPrefix : 'lightcase-', transition : 'elastic', transitionIn : null, transitionOut : null, cssTransitions : true, speedIn : 350, speedOut : 250, maxWidth : 1000, maxHeight : 800, forceWidth : false, forceHeight : false, liveResize : true, fullScreenModeForMobile : true, mobileMatchExpression : /(iphone|ipod|ipad|android|blackberry|symbian)/, disableShrink : false, shrinkFactor : .75, overlayOpacity : .9, slideshow : false, timeout : 1000000000, swipe : false, useKeys : true, navigateEndless : false, closeOnOverlayClick : true, showTitle : false, showCaption : false, showSequenceInfo : false, inline : { width : 'auto', height : 'auto' }, ajax : { width : 'auto', height : 'auto', type : 'get', dataType : 'html', data : {} }, iframe : { width : 500, height : 500, frameborder : 0 }, flash : { width : 400, height : 205, wmode : 'transparent' }, video : { width : 800, height : 480, poster : '', preload : 'auto', controls : true, autobuffer : true, autoplay : true, loop : false }, type : null, typeMapping : { 'image' : 'jpg,jpeg,gif,png,bmp', 'flash' : 'swf', 'video' : 'mp4,mov,ogv,ogg,webm', 'iframe' : 'html,php', 'ajax' : 'txt', 'inline' : '#' }, errorMessage : function () { return '

' + lightcase.labels['errorMessage'] + '

'; }, markup : function () { $('body').append( $overlay = $('
'), $loading = $('
'), $case = $('') ); $case.append( $content = $('
'), $info = $('
'), $close = $('' + lightcase.labels['close'] + '') ); $info.append( $sequenceInfo = $('
'), $title = $('

'), $caption = $('

') ); $content.append( $contentInner = $('
'), $nav = $('
') ); $nav.append( $prev = $('' + lightcase.labels['navigator.prev'] + '').hide(), $next = $('' + lightcase.labels['navigator.next'] + '').hide(), $play = $('' + lightcase.labels['navigator.play'] + '').hide(), $pause = $('' + lightcase.labels['navigator.pause'] + '').hide() ); }, onInit : function () {}, onStart : function () {}, onFinish : function () {} }, options); lightcase.objectData = lightcase.getObjectData(this); lightcase.dimensions = lightcase.getDimensions(); // Call hook function on initialization lightcase.settings.onInit(); lightcase.addElements(); lightcase.lightcaseOpen(); }, /** * Gets the object data * * @param {object} $object * @return {object} objectData */ getObjectData : function ($object) { var objectData = { $link : $object, title : $object.attr('title'), caption : $object.children('img').attr('alt'), url : lightcase.verifyDataUrl($object.attr('data-href') || $object.attr('href')), requestType : lightcase.settings.ajax.type, requestData : lightcase.settings.ajax.data, responseDataType : lightcase.settings.ajax.dataType, rel : $object.attr('data-rel'), type : lightcase.settings.type || lightcase.verifyDataType($object.attr('data-href') || $object.attr('href')), isPartOfSequence : lightcase.isPartOfSequence($object.attr('data-rel'), ':'), isPartOfSequenceWithSlideshow : lightcase.isPartOfSequence($object.attr('data-rel'), ':slideshow'), currentIndex : $('[data-rel="' + $object.attr('data-rel') + '"]').index($object), sequenceLength : $('[data-rel="' + $object.attr('data-rel') + '"]').length }; // Add sequence info to objectData objectData.sequenceInfo = (objectData.currentIndex + 1) + lightcase.labels['sequenceInfo.of'] + objectData.sequenceLength; return objectData; }, /** * Verifies if the link is part of a sequence * * @param {string} rel * @param {string} expression * @return {boolean} */ isPartOfSequence : function (rel, expression) { var getSimilarLinks = $('[data-rel="' + rel + '"]'), regexp = new RegExp(expression); if (regexp.test(rel) && getSimilarLinks.length > 1) { return true; } else { return false; } }, /** * Verifies if the slideshow should be enabled * * @return {boolean} */ isSlideshowEnabled : function () { if (lightcase.objectData.isPartOfSequence && (lightcase.settings.slideshow === true || lightcase.objectData.isPartOfSequenceWithSlideshow === true)) { return true; } else { return false; } }, /** * Loads the new content to show * * @return {void} */ loadContent : function () { if (lightcase.cache.originalObject) { lightcase.restoreObject(); } lightcase.createObject(); }, /** * Creates a new object * * @return {void} */ createObject : function () { var $object; // Create object switch (lightcase.objectData.type) { case 'image' : $object = $(new Image()); $object.attr({ // The time expression is required to prevent the binding of an image load 'src' : lightcase.objectData.url + '?random=' + (new Date()).getTime(), 'alt' : lightcase.objectData.title }); break; case 'inline' : $object = $('
'); $object.html(lightcase.cloneObject($(lightcase.objectData.url))); // Add custom attributes from lightcase.settings $.each(lightcase.settings.inline, function (name, value) { $object.attr('data-' + name, value); }); break; case 'ajax' : $object = $('
'); // Add custom attributes from lightcase.settings $.each(lightcase.settings.ajax, function (name, value) { if (name !== 'data') { $object.attr('data-' + name, value); } }); break; case 'flash' : $object = $(''); // Add custom attributes from lightcase.settings $.each(lightcase.settings.flash, function (name, value) { $object.attr(name, value); }); break; case 'video' : $object = $(''); $object.attr('src', lightcase.objectData.url); // Add custom attributes from lightcase.settings $.each(lightcase.settings.video, function (name, value) { $object.attr(name, value); }); break; default : $object = $(''); $object.attr({ 'src' : lightcase.objectData.url }); // Add custom attributes from lightcase.settings $.each(lightcase.settings.iframe, function (name, value) { $object.attr(name, value); }); } lightcase.addObject($object); lightcase.loadObject($object); }, /** * Adds the new object to the markup * * @param {object} $object * @return {void} */ addObject : function ($object) { // Add object to content holder $contentInner.html($object); // Start loading lightcase.loading('start'); // Call hook function on start lightcase.settings.onStart(); // Add sequenceInfo to the content holder or hide if its empty if (lightcase.settings.showSequenceInfo === true && lightcase.objectData.isPartOfSequence) { $sequenceInfo.html(lightcase.objectData.sequenceInfo); $sequenceInfo.show(); } else { $sequenceInfo.empty(); $sequenceInfo.hide(); } // Add title to the content holder or hide if its empty if (lightcase.settings.showTitle === true && lightcase.objectData.title !== undefined && lightcase.objectData.title !== '') { $title.html(lightcase.objectData.title); $title.show(); } else { $title.empty(); $title.hide(); } // Add caption to the content holder or hide if its empty if (lightcase.settings.showCaption === true && lightcase.objectData.caption !== undefined && lightcase.objectData.caption !== '') { $caption.html(lightcase.objectData.caption); $caption.show(); } else { $caption.empty(); $caption.hide(); } }, /** * Loads the new object * * @param {object} $object * @return {void} */ loadObject : function ($object) { // Load the object switch (lightcase.objectData.type) { case 'inline' : if ($(lightcase.objectData.url)) { lightcase.showContent($object); } else { lightcase.error(); } break; case 'ajax' : $.ajax( $.extend({}, lightcase.settings.ajax, { url : lightcase.objectData.url, type : lightcase.objectData.requestType, dataType : lightcase.objectData.requestDataType, data : lightcase.objectData.requestData, success : function (data, textStatus, jqXHR) { // Unserialize if data is transeferred as json if (lightcase.objectData.responseDataType === 'json') { data = $.parseJSON(data); } $object.html(data); lightcase.showContent($object); }, error : function (jqXHR, textStatus, errorThrown) { lightcase.error(); } }) ); break; case 'flash' : lightcase.showContent($object); break; case 'video' : if (typeof($object.get(0).canPlayType) === 'function' || $case.find('video').length === 0) { lightcase.showContent($object); } else { lightcase.error(); } break; default : if (lightcase.objectData.url) { $object.load(function () { lightcase.showContent($object); }); $object.error(function () { lightcase.error(); }); } else { lightcase.error(); } } }, /** * Throws an error message if something went wrong * * @return {void} */ error : function () { lightcase.objectData.type = 'error'; var $object = $('
'); $object.html(lightcase.settings.errorMessage); $contentInner.html($object); lightcase.showContent($contentInner); }, /** * Calculates the dimensions to fit content * * @param {object} $object * @return {void} */ calculateDimensions : function ($object) { lightcase.cleanupDimensions(); // Set default dimensions var dimensions = { objectWidth : $object.attr('width') ? $object.attr('width') : $object.attr('data-width'), objectHeight : $object.attr('height') ? $object.attr('height') : $object.attr('data-height'), maxWidth : parseInt(lightcase.dimensions.windowWidth * lightcase.settings.shrinkFactor), maxHeight : parseInt(lightcase.dimensions.windowHeight * lightcase.settings.shrinkFactor) }; if (!lightcase.settings.disableShrink) { // If the auto calculated maxWidth/maxHeight greather than the userdefined one, use that. if (dimensions.maxWidth > lightcase.settings.maxWidth) { dimensions.maxWidth = lightcase.settings.maxWidth; } if (dimensions.maxHeight > lightcase.settings.maxHeight) { dimensions.maxHeight = lightcase.settings.maxHeight; } // Calculate the difference between screen width/height and image width/height dimensions.differenceWidthAsPercent = parseInt(100 / dimensions.maxWidth * dimensions.objectWidth); dimensions.differenceHeightAsPercent = parseInt(100 / dimensions.maxHeight * dimensions.objectHeight); switch (lightcase.objectData.type) { case 'image' : case 'flash' : case 'video' : if (dimensions.differenceWidthAsPercent > 100 && dimensions.differenceWidthAsPercent > dimensions.differenceHeightAsPercent) { dimensions.objectWidth = dimensions.maxWidth; dimensions.objectHeight = parseInt(dimensions.objectHeight / dimensions.differenceWidthAsPercent * 100); } if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceHeightAsPercent > dimensions.differenceWidthAsPercent) { dimensions.objectWidth = parseInt(dimensions.objectWidth / dimensions.differenceHeightAsPercent * 100); dimensions.objectHeight = dimensions.maxHeight; } if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceWidthAsPercent < dimensions.differenceHeightAsPercent) { dimensions.objectWidth = parseInt(dimensions.maxWidth / dimensions.differenceHeightAsPercent * dimensions.differenceWidthAsPercent); dimensions.objectHeight = dimensions.maxHeight; } break; case 'error' : if (!isNaN(dimensions.objectWidth) && dimensions.objectWidth > dimensions.maxWidth) { dimensions.objectWidth = dimensions.maxWidth; } break; default : if ((isNaN(dimensions.objectWidth) || dimensions.objectWidth > dimensions.maxWidth) && !lightcase.settings.forceWidth) { dimensions.objectWidth = dimensions.maxWidth; } if (((isNaN(dimensions.objectHeight) && dimensions.objectHeight !== 'auto') || dimensions.objectHeight > dimensions.maxHeight) && !lightcase.settings.forceHeight) { dimensions.objectHeight = dimensions.maxHeight; } } } lightcase.adjustDimensions($object, dimensions); }, /** * Adjusts the dimensions * * @param {object} $object * @param {object} dimensions * @return {void} */ adjustDimensions : function ($object, dimensions) { // Adjust width and height $object.css({ 'width' : dimensions.objectWidth, 'height' : dimensions.objectHeight, 'max-width' : $object.attr('data-max-width') ? $object.attr('data-max-width') : dimensions.maxWidth, 'max-height' : $object.attr('data-max-height') ? $object.attr('data-max-height') : dimensions.maxHeight }); $contentInner.css({ 'width' : $object.outerWidth(), 'height' : $object.outerHeight(), 'max-width' : '100%' }); $case.css({ 'width' : $contentInner.outerWidth() }); // Adjust margin $case.css({ 'margin-top' : parseInt(-($case.outerHeight() / 2)), 'margin-left' : parseInt(-($case.outerWidth() / 2)) }); }, /** * Handles the loading * * @param {string} process * @return {void} */ loading : function (process) { if (process === 'start') { $case.addClass(lightcase.settings.classPrefix + 'loading'); $loading.show(); } else if (process === 'end') { $case.removeClass(lightcase.settings.classPrefix + 'loading'); $loading.hide(); } }, /** * Gets the client screen dimensions * * @return {object} dimensions */ getDimensions : function () { return { windowWidth : $(window).innerWidth(), windowHeight : $(window).innerHeight() }; }, /** * Verifies the url * * @param {string} dataUrl * @return {string} dataUrl Clean url for processing content */ verifyDataUrl : function (dataUrl) { if (!dataUrl || dataUrl === undefined || dataUrl === '') { return false; } if (dataUrl.indexOf('#') > -1) { dataUrl = dataUrl.split('#'); dataUrl = '#' + dataUrl[dataUrl.length - 1]; } return dataUrl; }, /** * Verifies the data type of the content to load * * @param {string} url * @return {string|boolean} Array key if expression matched, else false */ verifyDataType : function (url) { var url = lightcase.verifyDataUrl(url), typeMapping = lightcase.settings.typeMapping; if (url) { for (var key in typeMapping) { var suffixArr = typeMapping[key].split(','); for (var i = 0; i < suffixArr.length; i++) { var suffix = suffixArr[i] ,regexp = new RegExp('\.(' + suffix + ')$', 'i') // Verify only the last 4 characters of the string ,str = url.split('?')[0].substr(-4); if (regexp.test(str) === true) { return key; } else if (key === 'inline' && (url.indexOf(suffix) > -1 || !url)) { return key; } } } } // If no expression matched, return 'iframe'. return 'iframe'; }, /** * Extends html markup with the essential tags * * @return {void} */ addElements : function () { if ($('[id^="' + lightcase.settings.idPrefix + '"]').length) { return; } lightcase.settings.markup(); }, /** * Shows the loaded content * * @param {object} $object * @return {void} */ showContent : function ($object) { // Adds class with the object type $case.attr('class', 'type-' + lightcase.objectData.type); lightcase.cache.object = $object; lightcase.calculateDimensions($object); // Call hook function on finish lightcase.settings.onFinish(); switch (lightcase.settings.transitionIn) { case 'scrollTop' : case 'scrollRight' : case 'scrollBottom' : case 'scrollLeft' : case 'scrollHorizontal' : case 'scrollVertical' : lightcase.transition.scroll($case, 'in', lightcase.settings.speedIn); lightcase.transition.fade($contentInner, 'in', lightcase.settings.speedIn); break; case 'elastic' : if ($case.css('opacity') < 1) { lightcase.transition.zoom($case, 'in', lightcase.settings.speedIn); lightcase.transition.fade($contentInner, 'in', lightcase.settings.speedIn); } case 'fade' : case 'fadeInline' : lightcase.transition.fade($case, 'in', lightcase.settings.speedIn); lightcase.transition.fade($contentInner, 'in', lightcase.settings.speedIn); break; default : lightcase.transition.fade($case, 'in', 0); } // End loading lightcase.loading('end'); lightcase.busy = false; }, /** * Processes the content to show * * @return {void} */ processContent : function () { lightcase.busy = true; switch (lightcase.settings.transitionOut) { case 'scrollTop' : case 'scrollRight' : case 'scrollBottom' : case 'scrollLeft' : case 'scrollVertical' : case 'scrollHorizontal' : if ($case.is(':hidden')) { lightcase.transition.fade($case, 'out', 0, 0, function () { lightcase.loadContent(); }); lightcase.transition.fade($contentInner, 'out', 0); } else { lightcase.transition.scroll($case, 'out', lightcase.settings.speedOut, function () { lightcase.loadContent(); }); lightcase.transition.fade($contentInner, 'out', 0); } break; case 'fade' : if ($case.is(':hidden')) { lightcase.transition.fade($case, 'out', 0, 0, function () { lightcase.loadContent(); }); } else { lightcase.transition.fade($case, 'out', lightcase.settings.speedOut, 0, function () { lightcase.loadContent(); }); } break; case 'fadeInline' : case 'elastic' : if ($case.is(':hidden')) { lightcase.transition.fade($case, 'out', 0, 0, function () { lightcase.loadContent(); }); } else { lightcase.transition.fade($contentInner, 'out', lightcase.settings.speedOut, 0, function () { lightcase.loadContent(); }); } break; default : lightcase.transition.fade($case, 'out', 0, 0, function () { lightcase.loadContent(); }); } }, /** * Handles events for gallery buttons * * @return {void} */ handleEvents : function () { lightcase.unbindEvents(); $nav.children().hide(); // If slideshow is enabled, show play/pause and start timeout. if (lightcase.isSlideshowEnabled()) { $play.show(); $pause.show(); // Only start the timeout if slideshow is not pausing if (!$nav.hasClass(lightcase.settings.classPrefix + 'paused')) { lightcase.startTimeout(); } } if (lightcase.settings.liveResize) { $(window).resize(function () { if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } if (lightcase.open) { lightcase.dimensions = lightcase.getDimensions(); lightcase.calculateDimensions(lightcase.cache.object); } }); } $close.click(function (event) { event.preventDefault(); lightcase.lightcaseClose(); }); if (lightcase.settings.closeOnOverlayClick === true) { $overlay.css('cursor', 'pointer').click(function (event) { event.preventDefault(); lightcase.lightcaseClose(); }); } if (lightcase.settings.useKeys === true) { lightcase.addKeyEvents(); } if (lightcase.objectData.isPartOfSequence) { lightcase.nav = lightcase.setNavigation(); $prev.click(function (event) { event.preventDefault(); $prev.unbind('click'); lightcase.cache.action = 'prev'; lightcase.nav.$prevItem.click(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } }); $next.click(function (event) { event.preventDefault(); $next.unbind('click'); lightcase.cache.action = 'next'; lightcase.nav.$nextItem.click(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } }); if (lightcase.isSlideshowEnabled()) { $play.click(function (event) { event.preventDefault(); lightcase.startTimeout(); }); $pause.click(function (event) { event.preventDefault(); lightcase.stopTimeout(); }); } // Enable swiping if activated if (lightcase.settings.swipe === true) { if ($.isPlainObject($.event.special.swipeleft)) { $case.on('swipeleft', function (event) { event.preventDefault(); $next.click(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } }); } if ($.isPlainObject($.event.special.swiperight)) { $case.on('swiperight', function (event) { event.preventDefault(); $prev.click(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } }); } } } }, /** * Adds the key events * * @return {void} */ addKeyEvents : function () { $(document).keyup(function (event) { // Do nothing if lightcase is in process if (lightcase.busy) { return; } switch (event.keyCode) { // Escape key case 27 : $close.click(); break; // Backward key case 37 : if (lightcase.objectData.isPartOfSequence) { $prev.click(); } break; // Forward key case 39 : if (lightcase.objectData.isPartOfSequence) { $next.click(); } break; } }); }, /** * Starts the slideshow timeout * * @return {void} */ startTimeout : function () { $play.hide(); $pause.show(); lightcase.cache.action = 'next'; $nav.removeClass(lightcase.settings.classPrefix + 'paused'); lightcase.timeout = setTimeout(function () { lightcase.nav.$nextItem.click(); }, lightcase.settings.timeout); }, /** * Stops the slideshow timeout * * @return {void} */ stopTimeout : function () { $play.show(); $pause.hide(); $nav.addClass(lightcase.settings.classPrefix + 'paused'); clearTimeout(lightcase.timeout); }, /** * Sets the navigator buttons (prev/next) * * @return {object} items */ setNavigation : function () { var $links = $('[data-rel="' + lightcase.objectData.rel + '"]'), currentIndex = lightcase.objectData.currentIndex, prevIndex = currentIndex - 1, nextIndex = currentIndex + 1, sequenceLength = lightcase.objectData.sequenceLength - 1, items = { $prevItem : $links.eq(prevIndex), $nextItem : $links.eq(nextIndex) }; if (currentIndex > 0) { $prev.show(); } else { items.$prevItem = $links.eq(sequenceLength); } if (nextIndex <= sequenceLength) { $next.show(); } else { items.$nextItem = $links.eq(0); } if (lightcase.settings.navigateEndless === true) { $prev.show(); $next.show(); } return items; }, /** * Clones the object for inline elements * * @param {object} $object * @return {object} $clone */ cloneObject : function ($object) { var $clone = $object.clone(), objectId = $object.attr('id'); // If element is hidden, cache the object and remove if ($object.is(':hidden')) { lightcase.cacheObjectData($object); $object.attr('id', lightcase.settings.idPrefix + 'temp-' + objectId).empty(); } else { // Prevent duplicated id's $clone.removeAttr('id'); } return $clone.show(); }, /** * Verifies if it is a mobile device * * @return {boolean} */ isMobileDevice : function () { var deviceAgent = navigator.userAgent.toLowerCase(), agentId = deviceAgent.match(lightcase.settings.mobileMatchExpression); return agentId ? true : false; }, /** * Verifies if css transitions are supported * * @return {string|boolean} The transition prefix if supported, else false. */ isTransitionSupported : function () { var body = $('body').get(0), isTransitionSupported = false, transitionMapping = { 'transition' : '', 'WebkitTransition' : '-webkit-', 'MozTransition' : '-moz-', 'OTransition' : '-o-', 'MsTransition' : '-ms-' }; for (var key in transitionMapping) { if (transitionMapping.hasOwnProperty(key) && key in body.style) { lightcase.support.transition = transitionMapping[key]; isTransitionSupported = true; } } return isTransitionSupported; }, /** * Transition types * */ transition : { /** * Fades in/out the object * * @param {object} $object * @param {string} type * @param {number} speed * @param {number} opacity * @param {function} callback * @return {void} Animates an object */ fade : function ($object, type, speed, opacity, callback) { var isInTransition = type === 'in', startTransition = {}, startOpacity = $object.css('opacity'), endTransition = {}, endOpacity = opacity ? opacity : isInTransition ? 1 : 0 if (!lightcase.open && isInTransition) return; startTransition['opacity'] = startOpacity; endTransition['opacity'] = endOpacity; $object.css(startTransition).show(); // Css transition if (lightcase.support.transitions) { endTransition[lightcase.support.transition + 'transition'] = speed + 'ms ease-out'; setTimeout(function () { $object.css(endTransition); }, 15); setTimeout(function () { $object.css(lightcase.support.transition + 'transition', ''); if (callback && (lightcase.open || !isInTransition)) { callback(); } }, speed); } else { // Fallback to js transition $object.stop(); $object.animate(endTransition, speed, callback); } }, /** * Scrolls in/out the object * * @param {object} $object * @param {string} type * @param {number} speed * @param {function} callback * @return {void} Animates an object */ scroll : function ($object, type, speed, callback) { var isInTransition = type === 'in', transition = isInTransition ? lightcase.settings.transitionIn : lightcase.settings.transitionOut, direction = 'left', startTransition = {}, startOpacity = isInTransition ? 0 : 1, startOffset = isInTransition ? '-50%' : '50%', endTransition = {}, endOpacity = isInTransition ? 1 : 0, endOffset = isInTransition ? '50%' : '-50%'; if (!lightcase.open && isInTransition) return; switch (transition) { case 'scrollTop' : direction = 'top'; break; case 'scrollRight' : startOffset = isInTransition ? '150%' : '50%'; endOffset = isInTransition ? '50%' : '150%'; break; case 'scrollBottom' : direction = 'top'; startOffset = isInTransition ? '150%' : '50%'; endOffset = isInTransition ? '50%' : '150%'; break; case 'scrollHorizontal' : startOffset = isInTransition ? '150%' : '50%'; endOffset = isInTransition ? '50%' : '-50%'; break; case 'scrollVertical' : direction = 'top'; startOffset = isInTransition ? '-50%' : '50%'; endOffset = isInTransition ? '50%' : '150%'; break; } if (lightcase.cache.action === 'prev') { switch (transition) { case 'scrollHorizontal' : startOffset = isInTransition ? '-50%' : '50%'; endOffset = isInTransition ? '50%' : '150%'; break; case 'scrollVertical' : startOffset = isInTransition ? '150%' : '50%'; endOffset = isInTransition ? '50%' : '-50%'; break; } } startTransition['opacity'] = startOpacity; startTransition[direction] = startOffset; endTransition['opacity'] = endOpacity; endTransition[direction] = endOffset; $object.css(startTransition).show(); // Css transition if (lightcase.support.transitions) { endTransition[lightcase.support.transition + 'transition'] = speed + 'ms ease-out'; setTimeout(function () { $object.css(endTransition); }, 0); setTimeout(function () { $object.css(lightcase.support.transition + 'transition', ''); if (callback && (lightcase.open || !isInTransition)) { callback(); } }, speed); } else { // Fallback to js transition $object.stop(); $object.animate(endTransition, speed, callback); } }, /** * Zooms in/out the object * * @param {object} $object * @param {string} type * @param {number} speed * @param {function} callback * @return {void} Animates an object */ zoom : function ($object, type, speed, callback) { var isInTransition = type === 'in', startTransition = {}, startOpacity = $object.css('opacity'), startScale = isInTransition ? 'scale(0.75)' : 'scale(1)', endTransition = {}, endOpacity = isInTransition ? 1 : 0, endScale = isInTransition ? 'scale(1)' : 'scale(0.75)'; if (!lightcase.open && isInTransition) return; startTransition['opacity'] = startOpacity; startTransition[lightcase.support.transition + 'transform'] = startScale; endTransition['opacity'] = endOpacity; $object.css(startTransition).show(); // Css transition if (lightcase.support.transitions) { endTransition[lightcase.support.transition + 'transform'] = endScale; endTransition[lightcase.support.transition + 'transition'] = speed + 'ms ease-out'; setTimeout(function () { $object.css(endTransition); }, 0); setTimeout(function () { $object.css(lightcase.support.transition + 'transform', ''); $object.css(lightcase.support.transition + 'transition', ''); if (callback && (lightcase.open || !isInTransition)) { callback(); } }, speed); } else { // Fallback to js transition $object.stop(); $object.animate(endTransition, speed, callback); } } }, /** * Caches the object data * * @param {object} $object * @return {void} */ cacheObjectData : function ($object) { $.data($object, 'cache', { id : $object.attr('id'), content : $object.html() }); lightcase.cache.originalObject = $object; }, /** * Restores the object from cache * * @return void */ restoreObject : function () { var $object = $('[id^="' + lightcase.settings.idPrefix + 'temp-"]'); $object.attr('id', $.data(lightcase.cache.originalObject, 'cache').id); $object.html($.data(lightcase.cache.originalObject, 'cache').content); }, /** * Enters into the lightcase view * * @return {void} */ lightcaseOpen : function () { lightcase.open = true; lightcase.support.transitions = lightcase.settings.cssTransitions ? lightcase.isTransitionSupported() : false; lightcase.support.mobileDevice = lightcase.isMobileDevice(); if (lightcase.support.mobileDevice) { $('html').addClass(lightcase.settings.classPrefix + 'isMobileDevice'); if (lightcase.settings.fullScreenModeForMobile) { lightcase.switchToFullScreenMode(); } } if (!lightcase.settings.transitionIn) { lightcase.settings.transitionIn = lightcase.settings.transition; } if (!lightcase.settings.transitionOut) { lightcase.settings.transitionOut = lightcase.settings.transition; } switch (lightcase.settings.transitionIn) { case 'fade' : case 'fadeInline' : case 'elastic' : case 'scrollTop' : case 'scrollRight' : case 'scrollBottom' : case 'scrollLeft' : case 'scrollVertical' : case 'scrollHorizontal' : if ($case.is(':hidden')) { $overlay.css('opacity', 0); $case.css('opacity', 0); $contentInner.css('opacity', 0); } lightcase.transition.fade($overlay, 'in', lightcase.settings.speedIn, lightcase.settings.overlayOpacity, function () { lightcase.handleEvents(); lightcase.processContent(); }); break; default : lightcase.transition.fade($overlay, 'in', 0, lightcase.settings.overlayOpacity, function () { lightcase.handleEvents(); lightcase.processContent(); }); } $('html').addClass(lightcase.settings.classPrefix + 'open'); $case.attr('aria-hidden', 'false'); }, /** * Escapes from the lightcase view * * @return {void} */ lightcaseClose : function () { lightcase.open = false; $loading.hide(); lightcase.unbindEvents(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); } $('html').removeClass(lightcase.settings.classPrefix + 'open'); $case.attr('aria-hidden', 'true'); switch (lightcase.settings.transitionOut) { case 'fade' : case 'fadeInline' : case 'scrollTop' : case 'scrollRight' : case 'scrollBottom' : case 'scrollLeft' : case 'scrollVertical' : case 'scrollHorizontal' : lightcase.transition.fade($case, 'out', lightcase.settings.speedOut, 0, function () { lightcase.transition.fade($overlay, 'out', lightcase.settings.speedOut, 0, function () { lightcase.cleanup(); }); }); break; case 'elastic' : lightcase.transition.zoom($case, 'out', lightcase.settings.speedOut, function () { lightcase.transition.fade($overlay, 'out', lightcase.settings.speedOut, 0, function () { lightcase.cleanup(); }); }); break; default : lightcase.cleanup(); } }, /** * Switches to the fullscreen mode * * @return {void} */ switchToFullScreenMode : function () { lightcase.settings.shrinkFactor = 1; lightcase.settings.overlayOpacity = 1; if (lightcase.settings.transitionIn !== 'none') { lightcase.settings.transitionIn = 'fade'; } if (lightcase.settings.transitionOut !== 'none') { lightcase.settings.transitionOut = 'fade'; } $('html').addClass(lightcase.settings.classPrefix + 'fullScreenMode'); }, /** * Unbinds all given events * * @return {void} */ unbindEvents : function () { // Unbind overlay event $overlay.unbind('click'); // Unbind key events $(document).unbind('keyup'); // Unbind swipe events $case.unbind('swipeleft').unbind('swiperight'); // Unbind navigator events $nav.children('a').unbind('click'); // Unbind close event $close.unbind('click'); }, /** * Cleans up the dimensions * * @return {void} */ cleanupDimensions : function () { var opacity = $contentInner.css('opacity'); $case.css({ 'width' : '', 'height' : '', 'top' : '', 'left' : '', 'margin-top' : '', 'margin-left' : '' }); $contentInner.removeAttr('style').css('opacity', opacity); $contentInner.children().removeAttr('style'); }, /** * Cleanup after aborting lightcase * * @return {void} */ cleanup : function () { lightcase.cleanupDimensions(); if (lightcase.isSlideshowEnabled()) { lightcase.stopTimeout(); $nav.removeClass(lightcase.settings.classPrefix + 'paused'); } $loading.hide(); $overlay.hide(); $case.hide().removeAttr('class'); $contentInner.empty().hide(); $info.children().empty(); if (lightcase.cache.originalObject) { lightcase.restoreObject(); } // Restore cache lightcase.cache = {}; } }; $.fn.lightcase = function (method) { // Method calling logic if (lightcase[method]) { return lightcase[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return lightcase.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exist on jQuery.lightcase'); } }; })(jQuery); $(function(){ $('#breakingnews1').BreakingNews({ title: '公告' }); $('#breakingnews2').BreakingNews({ title: '滚动新闻', titlebgcolor: '#333', linkhovercolor: '#e8800f', //border: '1px solid #099', timer: 4000, effect: 'slide' }); }); /** * jQuery Roundabout - v2.4.2 * http://fredhq.com/projects/roundabout * * Moves list-items of enabled ordered and unordered lists long * a chosen path. Includes the default "lazySusan" path, that * moves items long a spinning turntable. * * Terms of Use // jQuery Roundabout * * Open source under the BSD license * * Copyright (c) 2011-2012, Fred LeBlanc * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * - Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ (function($) { "use strict"; var defaults, internalData, methods; // add default shape $.extend({ roundaboutShapes: { def: "lazySusan", lazySusan: function (r, a, t) { return { x: Math.sin(r + a), y: (Math.sin(r + 3 * Math.PI / 2 + a) / 8) * t, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI / 2 + a) / 2) + 0.5 }; } } }); defaults = { bearing: 0.0, tilt: 0.0, minZ: 100, maxZ: 280, minOpacity: 0.4, maxOpacity: 1.0, minScale: 0.4, maxScale: 1.0, duration: 600, btnNext: null, btnNextCallback: function() {}, btnPrev: null, btnPrevCallback: function() {}, btnToggleAutoplay: null, btnStartAutoplay: null, btnStopAutoplay: null, easing: "swing", clickToFocus: true, clickToFocusCallback: function() {}, focusBearing: 0.0, shape: "lazySusan", debug: false, childSelector: "li", startingChild: null, reflect: false, floatComparisonThreshold: 0.001, autoplay: false, autoplayDuration: 1000, autoplayPauseOnHover: false, autoplayCallback: function() {}, autoplayInitialDelay: 0, enableDrag: false, dropDuration: 600, dropEasing: "swing", dropAnimateTo: "nearest", dropCallback: function() {}, dragAxis: "x", dragFactor: 4, triggerFocusEvents: true, triggerBlurEvents: true, responsive: false }; internalData = { autoplayInterval: null, autoplayIsRunning: false, autoplayStartTimeout: null, animating: false, childInFocus: -1, touchMoveStartPosition: null, stopAnimation: false, lastAnimationStep: false }; methods = { // starters // ----------------------------------------------------------------------- // init // starts up roundabout init: function(options, callback, relayout) { var settings, now = (new Date()).getTime(); options = (typeof options === "object") ? options : {}; callback = ($.isFunction(callback)) ? callback : function() {}; callback = ($.isFunction(options)) ? options : callback; settings = $.extend({}, defaults, options, internalData); return this .each(function() { // make options var self = $(this), childCount = self.children(settings.childSelector).length, period = 360.0 / childCount, startingChild = (settings.startingChild && settings.startingChild > (childCount - 1)) ? (childCount - 1) : settings.startingChild, startBearing = (settings.startingChild === null) ? settings.bearing : 360 - (startingChild * period), holderCSSPosition = (self.css("position") !== "static") ? self.css("position") : "relative"; self .css({ // starting styles padding: 0, position: holderCSSPosition }) .addClass("roundabout-holder") .data( // starting options "roundabout", $.extend( {}, settings, { startingChild: startingChild, bearing: startBearing, oppositeOfFocusBearing: methods.normalize.apply(null, [settings.focusBearing - 180]), dragBearing: startBearing, period: period } ) ); // unbind any events that we set if we're relaying out if (relayout) { self .unbind(".roundabout") .children(settings.childSelector) .unbind(".roundabout"); } else { // bind responsive action if (settings.responsive) { $(window).bind("resize", function() { methods.stopAutoplay.apply(self); methods.relayoutChildren.apply(self); }); } } // bind click-to-focus if (settings.clickToFocus) { self .children(settings.childSelector) .each(function(i) { $(this) .bind("click.roundabout", function() { var degrees = methods.getPlacement.apply(self, [i]); if (!methods.isInFocus.apply(self, [degrees])) { methods.stopAnimation.apply($(this)); if (!self.data("roundabout").animating) { methods.animateBearingToFocus.apply(self, [degrees, self.data("roundabout").clickToFocusCallback]); } return false; } }); }); } // bind next buttons if (settings.btnNext) { $(settings.btnNext) .bind("click.roundabout", function() { if (!self.data("roundabout").animating) { methods.animateToNextChild.apply(self, [self.data("roundabout").btnNextCallback]); } return false; }); } // bind previous buttons if (settings.btnPrev) { $(settings.btnPrev) .bind("click.roundabout", function() { methods.animateToPreviousChild.apply(self, [self.data("roundabout").btnPrevCallback]); return false; }); } // bind toggle autoplay buttons if (settings.btnToggleAutoplay) { $(settings.btnToggleAutoplay) .bind("click.roundabout", function() { methods.toggleAutoplay.apply(self); return false; }); } // bind start autoplay buttons if (settings.btnStartAutoplay) { $(settings.btnStartAutoplay) .bind("click.roundabout", function() { methods.startAutoplay.apply(self); return false; }); } // bind stop autoplay buttons if (settings.btnStopAutoplay) { $(settings.btnStopAutoplay) .bind("click.roundabout", function() { methods.stopAutoplay.apply(self); return false; }); } // autoplay pause on hover if (settings.autoplayPauseOnHover) { self .bind("mouseenter.roundabout.autoplay", function() { methods.stopAutoplay.apply(self, [true]); }) .bind("mouseleave.roundabout.autoplay", function() { methods.startAutoplay.apply(self); }); } // drag and drop if (settings.enableDrag) { // on screen if (!$.isFunction(self.drag)) { if (settings.debug) { alert("You do not have the drag plugin loaded."); } } else if (!$.isFunction(self.drop)) { if (settings.debug) { alert("You do not have the drop plugin loaded."); } } else { self .drag(function(e, properties) { var data = self.data("roundabout"), delta = (data.dragAxis.toLowerCase() === "x") ? "deltaX" : "deltaY"; methods.stopAnimation.apply(self); methods.setBearing.apply(self, [data.dragBearing + properties[delta] / data.dragFactor]); }) .drop(function(e) { var data = self.data("roundabout"), method = methods.getAnimateToMethod(data.dropAnimateTo); methods.allowAnimation.apply(self); methods[method].apply(self, [data.dropDuration, data.dropEasing, data.dropCallback]); data.dragBearing = data.period * methods.getNearestChild.apply(self); }); } // on mobile self .each(function() { var element = $(this).get(0), data = $(this).data("roundabout"), page = (data.dragAxis.toLowerCase() === "x") ? "pageX" : "pageY", method = methods.getAnimateToMethod(data.dropAnimateTo); // some versions of IE don't like this if (element.addEventListener) { element.addEventListener("touchstart", function(e) { data.touchMoveStartPosition = e.touches[0][page]; }, false); element.addEventListener("touchmove", function(e) { var delta = (e.touches[0][page] - data.touchMoveStartPosition) / data.dragFactor; e.preventDefault(); methods.stopAnimation.apply($(this)); methods.setBearing.apply($(this), [data.dragBearing + delta]); }, false); element.addEventListener("touchend", function(e) { e.preventDefault(); methods.allowAnimation.apply($(this)); method = methods.getAnimateToMethod(data.dropAnimateTo); methods[method].apply($(this), [data.dropDuration, data.dropEasing, data.dropCallback]); data.dragBearing = data.period * methods.getNearestChild.apply($(this)); }, false); } }); } // start children methods.initChildren.apply(self, [callback, relayout]); }); }, // initChildren // applys settings to child elements, starts roundabout initChildren: function(callback, relayout) { var self = $(this), data = self.data("roundabout"); callback = callback || function() {}; self.children(data.childSelector).each(function(i) { var startWidth, startHeight, startFontSize, degrees = methods.getPlacement.apply(self, [i]); // on relayout, grab these values from current data if (relayout && $(this).data("roundabout")) { startWidth = $(this).data("roundabout").startWidth; startHeight = $(this).data("roundabout").startHeight; startFontSize = $(this).data("roundabout").startFontSize; } // apply classes and css first $(this) .addClass("roundabout-moveable-item") .css("position", "absolute"); // now measure $(this) .data( "roundabout", { startWidth: startWidth || $(this).width(), startHeight: startHeight || $(this).height(), startFontSize: startFontSize || parseInt($(this).css("font-size"), 10), degrees: degrees, backDegrees: methods.normalize.apply(null, [degrees - 180]), childNumber: i, currentScale: 1, parent: self } ); }); methods.updateChildren.apply(self); // start autoplay if necessary if (data.autoplay) { data.autoplayStartTimeout = setTimeout(function() { methods.startAutoplay.apply(self); }, data.autoplayInitialDelay); } self.trigger('ready'); callback.apply(self); return self; }, // positioning // ----------------------------------------------------------------------- // updateChildren // move children elements into their proper locations updateChildren: function() { return this .each(function() { var self = $(this), data = self.data("roundabout"), inFocus = -1, info = { bearing: data.bearing, tilt: data.tilt, stage: { width: Math.floor($(this).width() * 0.9), height: Math.floor($(this).height() * 0.9) }, animating: data.animating, inFocus: data.childInFocus, focusBearingRadian: methods.degToRad.apply(null, [data.focusBearing]), shape: $.roundaboutShapes[data.shape] || $.roundaboutShapes[$.roundaboutShapes.def] }; // calculations info.midStage = { width: info.stage.width / 2, height: info.stage.height / 2 }; info.nudge = { width: info.midStage.width + (info.stage.width * 0.05), height: info.midStage.height + (info.stage.height * 0.05) }; info.zValues = { min: data.minZ, max: data.maxZ, diff: data.maxZ - data.minZ }; info.opacity = { min: data.minOpacity, max: data.maxOpacity, diff: data.maxOpacity - data.minOpacity }; info.scale = { min: data.minScale, max: data.maxScale, diff: data.maxScale - data.minScale }; // update child positions self.children(data.childSelector) .each(function(i) { if (methods.updateChild.apply(self, [$(this), info, i, function() { $(this).trigger('ready'); }]) && (!info.animating || data.lastAnimationStep)) { inFocus = i; $(this).addClass("roundabout-in-focus"); } else { $(this).removeClass("roundabout-in-focus"); } }); if (inFocus !== info.inFocus) { // blur old child if (data.triggerBlurEvents) { self.children(data.childSelector) .eq(info.inFocus) .trigger("blur"); } data.childInFocus = inFocus; if (data.triggerFocusEvents && inFocus !== -1) { // focus new child self.children(data.childSelector) .eq(inFocus) .trigger("focus"); } } self.trigger("childrenUpdated"); }); }, // updateChild // repositions a child element into its new position updateChild: function(childElement, info, childPos, callback) { var factors, self = this, child = $(childElement), data = child.data("roundabout"), out = [], rad = methods.degToRad.apply(null, [(360.0 - data.degrees) + info.bearing]); callback = callback || function() {}; // adjust radians to be between 0 and Math.PI * 2 rad = methods.normalizeRad.apply(null, [rad]); // get factors from shape factors = info.shape(rad, info.focusBearingRadian, info.tilt); // correct factors.scale = (factors.scale > 1) ? 1 : factors.scale; factors.adjustedScale = (info.scale.min + (info.scale.diff * factors.scale)).toFixed(4); factors.width = (factors.adjustedScale * data.startWidth).toFixed(4); factors.height = (factors.adjustedScale * data.startHeight).toFixed(4); // update item child .css({ left: ((factors.x * info.midStage.width + info.nudge.width) - factors.width / 2.0).toFixed(0) + "px", top: ((factors.y * info.midStage.height + info.nudge.height) - factors.height / 2.0).toFixed(0) + "px", width: factors.width + "px", height: factors.height + "px", opacity: (info.opacity.min + (info.opacity.diff * factors.scale)).toFixed(2), zIndex: Math.round(info.zValues.min + (info.zValues.diff * factors.z)), fontSize: (factors.adjustedScale * data.startFontSize).toFixed(1) + "px" }); data.currentScale = factors.adjustedScale; // for debugging purposes if (self.data("roundabout").debug) { out.push("
"); out.push("Child " + childPos + "
"); out.push("left: " + child.css("left") + "
"); out.push("top: " + child.css("top") + "
"); out.push("width: " + child.css("width") + "
"); out.push("opacity: " + child.css("opacity") + "
"); out.push("height: " + child.css("height") + "
"); out.push("z-index: " + child.css("z-index") + "
"); out.push("font-size: " + child.css("font-size") + "
"); out.push("scale: " + child.data("roundabout").currentScale); out.push("
"); child.html(out.join("")); } // trigger event child.trigger("reposition"); // callback callback.apply(self); return methods.isInFocus.apply(self, [data.degrees]); }, // manipulation // ----------------------------------------------------------------------- // setBearing // changes the bearing of the roundabout setBearing: function(bearing, callback) { callback = callback || function() {}; bearing = methods.normalize.apply(null, [bearing]); this .each(function() { var diff, lowerValue, higherValue, self = $(this), data = self.data("roundabout"), oldBearing = data.bearing; // set bearing data.bearing = bearing; self.trigger("bearingSet"); methods.updateChildren.apply(self); // not animating? we're done here diff = Math.abs(oldBearing - bearing); if (!data.animating || diff > 180) { return; } // check to see if any of the children went through the back diff = Math.abs(oldBearing - bearing); self.children(data.childSelector).each(function(i) { var eventType; if (methods.isChildBackDegreesBetween.apply($(this), [bearing, oldBearing])) { eventType = (oldBearing > bearing) ? "Clockwise" : "Counterclockwise"; $(this).trigger("move" + eventType + "ThroughBack"); } }); }); // call callback if one was given callback.apply(this); return this; }, // adjustBearing // change the bearing of the roundabout by a given degree adjustBearing: function(delta, callback) { callback = callback || function() {}; if (delta === 0) { return this; } this .each(function() { methods.setBearing.apply($(this), [$(this).data("roundabout").bearing + delta]); }); callback.apply(this); return this; }, // setTilt // changes the tilt of the roundabout setTilt: function(tilt, callback) { callback = callback || function() {}; this .each(function() { $(this).data("roundabout").tilt = tilt; methods.updateChildren.apply($(this)); }); // call callback if one was given callback.apply(this); return this; }, // adjustTilt // changes the tilt of the roundabout adjustTilt: function(delta, callback) { callback = callback || function() {}; this .each(function() { methods.setTilt.apply($(this), [$(this).data("roundabout").tilt + delta]); }); callback.apply(this); return this; }, // animation // ----------------------------------------------------------------------- // animateToBearing // animates the roundabout to a given bearing, all animations come through here animateToBearing: function(bearing, duration, easing, passedData, callback) { var now = (new Date()).getTime(); callback = callback || function() {}; // find callback function in arguments if ($.isFunction(passedData)) { callback = passedData; passedData = null; } else if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } this .each(function() { var timer, easingFn, newBearing, self = $(this), data = self.data("roundabout"), thisDuration = (!duration) ? data.duration : duration, thisEasingType = (easing) ? easing : data.easing || "swing"; // is this your first time? if (!passedData) { passedData = { timerStart: now, start: data.bearing, totalTime: thisDuration }; } // update the timer timer = now - passedData.timerStart; if (data.stopAnimation) { methods.allowAnimation.apply(self); data.animating = false; return; } // we need to animate more if (timer < thisDuration) { if (!data.animating) { self.trigger("animationStart"); } data.animating = true; if (typeof $.easing.def === "string") { easingFn = $.easing[thisEasingType] || $.easing[$.easing.def]; newBearing = easingFn(null, timer, passedData.start, bearing - passedData.start, passedData.totalTime); } else { newBearing = $.easing[thisEasingType]((timer / passedData.totalTime), timer, passedData.start, bearing - passedData.start, passedData.totalTime); } // fixes issue #24, animation changed as of jQuery 1.7.2 // also addresses issue #29, using easing breaks "linear" if (methods.compareVersions.apply(null, [$().jquery, "1.7.2"]) >= 0 && !($.easing["easeOutBack"])) { newBearing = passedData.start + ((bearing - passedData.start) * newBearing); } newBearing = methods.normalize.apply(null, [newBearing]); data.dragBearing = newBearing; methods.setBearing.apply(self, [newBearing, function() { setTimeout(function() { // done with a timeout so that each step is displayed methods.animateToBearing.apply(self, [bearing, thisDuration, thisEasingType, passedData, callback]); }, 0); }]); // we're done animating } else { data.lastAnimationStep = true; bearing = methods.normalize.apply(null, [bearing]); methods.setBearing.apply(self, [bearing, function() { self.trigger("animationEnd"); }]); data.animating = false; data.lastAnimationStep = false; data.dragBearing = bearing; callback.apply(self); } }); return this; }, // animateToNearbyChild // animates roundabout to a nearby child animateToNearbyChild: function(passedArgs, which) { var duration = passedArgs[0], easing = passedArgs[1], callback = passedArgs[2] || function() {}; // find callback if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } return this .each(function() { var j, range, self = $(this), data = self.data("roundabout"), bearing = (!data.reflect) ? data.bearing % 360 : data.bearing, length = self.children(data.childSelector).length; if (!data.animating) { // reflecting, not moving to previous || not reflecting, moving to next if ((data.reflect && which === "previous") || (!data.reflect && which === "next")) { // slightly adjust for rounding issues bearing = (Math.abs(bearing) < data.floatComparisonThreshold) ? 360 : bearing; // clockwise for (j = 0; j < length; j += 1) { range = { lower: (data.period * j), upper: (data.period * (j + 1)) }; range.upper = (j === length - 1) ? 360 : range.upper; if (bearing <= Math.ceil(range.upper) && bearing >= Math.floor(range.lower)) { if (length === 2 && bearing === 360) { methods.animateToDelta.apply(self, [-180, duration, easing, callback]); } else { methods.animateBearingToFocus.apply(self, [range.lower, duration, easing, callback]); } break; } } } else { // slightly adjust for rounding issues bearing = (Math.abs(bearing) < data.floatComparisonThreshold || 360 - Math.abs(bearing) < data.floatComparisonThreshold) ? 0 : bearing; // counterclockwise for (j = length - 1; j >= 0; j -= 1) { range = { lower: data.period * j, upper: data.period * (j + 1) }; range.upper = (j === length - 1) ? 360 : range.upper; if (bearing >= Math.floor(range.lower) && bearing < Math.ceil(range.upper)) { if (length === 2 && bearing === 360) { methods.animateToDelta.apply(self, [180, duration, easing, callback]); } else { methods.animateBearingToFocus.apply(self, [range.upper, duration, easing, callback]); } break; } } } } }); }, // animateToNearestChild // animates roundabout to the nearest child animateToNearestChild: function(duration, easing, callback) { callback = callback || function() {}; // find callback if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } return this .each(function() { var nearest = methods.getNearestChild.apply($(this)); methods.animateToChild.apply($(this), [nearest, duration, easing, callback]); }); }, // animateToChild // animates roundabout to a given child position animateToChild: function(childPosition, duration, easing, callback) { callback = callback || function() {}; // find callback if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } return this .each(function() { var child, self = $(this), data = self.data("roundabout"); if (data.childInFocus !== childPosition && !data.animating) { child = self.children(data.childSelector).eq(childPosition); methods.animateBearingToFocus.apply(self, [child.data("roundabout").degrees, duration, easing, callback]); } }); }, // animateToNextChild // animates roundabout to the next child animateToNextChild: function(duration, easing, callback) { return methods.animateToNearbyChild.apply(this, [arguments, "next"]); }, // animateToPreviousChild // animates roundabout to the preious child animateToPreviousChild: function(duration, easing, callback) { return methods.animateToNearbyChild.apply(this, [arguments, "previous"]); }, // animateToDelta // animates roundabout to a given delta (in degrees) animateToDelta: function(degrees, duration, easing, callback) { callback = callback || function() {}; // find callback if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } return this .each(function() { var delta = $(this).data("roundabout").bearing + degrees; methods.animateToBearing.apply($(this), [delta, duration, easing, callback]); }); }, // animateBearingToFocus // animates roundabout to bring a given angle into focus animateBearingToFocus: function(degrees, duration, easing, callback) { callback = callback || function() {}; // find callback if ($.isFunction(easing)) { callback = easing; easing = null; } else if ($.isFunction(duration)) { callback = duration; duration = null; } return this .each(function() { var delta = $(this).data("roundabout").bearing - degrees; delta = (Math.abs(360 - delta) < Math.abs(delta)) ? 360 - delta : -delta; delta = (delta > 180) ? -(360 - delta) : delta; if (delta !== 0) { methods.animateToDelta.apply($(this), [delta, duration, easing, callback]); } }); }, // stopAnimation // if an animation is currently in progress, stop it stopAnimation: function() { return this .each(function() { $(this).data("roundabout").stopAnimation = true; }); }, // allowAnimation // clears the stop-animation hold placed by stopAnimation allowAnimation: function() { return this .each(function() { $(this).data("roundabout").stopAnimation = false; }); }, // autoplay // ----------------------------------------------------------------------- // startAutoplay // starts autoplaying this roundabout startAutoplay: function(callback) { return this .each(function() { var self = $(this), data = self.data("roundabout"); callback = callback || data.autoplayCallback || function() {}; clearInterval(data.autoplayInterval); data.autoplayInterval = setInterval(function() { methods.animateToNextChild.apply(self, [callback]); }, data.autoplayDuration); data.autoplayIsRunning = true; self.trigger("autoplayStart"); }); }, // stopAutoplay // stops autoplaying this roundabout stopAutoplay: function(keepAutoplayBindings) { return this .each(function() { clearInterval($(this).data("roundabout").autoplayInterval); $(this).data("roundabout").autoplayInterval = null; $(this).data("roundabout").autoplayIsRunning = false; // this will prevent autoplayPauseOnHover from restarting autoplay if (!keepAutoplayBindings) { $(this).unbind(".autoplay"); } $(this).trigger("autoplayStop"); }); }, // toggleAutoplay // toggles autoplay pause/resume toggleAutoplay: function(callback) { return this .each(function() { var self = $(this), data = self.data("roundabout"); callback = callback || data.autoplayCallback || function() {}; if (!methods.isAutoplaying.apply($(this))) { methods.startAutoplay.apply($(this), [callback]); } else { methods.stopAutoplay.apply($(this), [callback]); } }); }, // isAutoplaying // is this roundabout currently autoplaying? isAutoplaying: function() { return (this.data("roundabout").autoplayIsRunning); }, // changeAutoplayDuration // stops the autoplay, changes the duration, restarts autoplay changeAutoplayDuration: function(duration) { return this .each(function() { var self = $(this), data = self.data("roundabout"); data.autoplayDuration = duration; if (methods.isAutoplaying.apply(self)) { methods.stopAutoplay.apply(self); setTimeout(function() { methods.startAutoplay.apply(self); }, 10); } }); }, // helpers // ----------------------------------------------------------------------- // normalize // regulates degrees to be >= 0.0 and < 360 normalize: function(degrees) { var inRange = degrees % 360.0; return (inRange < 0) ? 360 + inRange : inRange; }, // normalizeRad // regulates radians to be >= 0 and < Math.PI * 2 normalizeRad: function(radians) { while (radians < 0) { radians += (Math.PI * 2); } while (radians > (Math.PI * 2)) { radians -= (Math.PI * 2); } return radians; }, // isChildBackDegreesBetween // checks that a given child's backDegrees is between two values isChildBackDegreesBetween: function(value1, value2) { var backDegrees = $(this).data("roundabout").backDegrees; if (value1 > value2) { return (backDegrees >= value2 && backDegrees < value1); } else { return (backDegrees < value2 && backDegrees >= value1); } }, // getAnimateToMethod // takes a user-entered option and maps it to an animation method getAnimateToMethod: function(effect) { effect = effect.toLowerCase(); if (effect === "next") { return "animateToNextChild"; } else if (effect === "previous") { return "animateToPreviousChild"; } // default selection return "animateToNearestChild"; }, // relayoutChildren // lays out children again with new contextual information relayoutChildren: function() { return this .each(function() { var self = $(this), settings = $.extend({}, self.data("roundabout")); settings.startingChild = self.data("roundabout").childInFocus; methods.init.apply(self, [settings, null, true]); }); }, // getNearestChild // gets the nearest child from the current bearing getNearestChild: function() { var self = $(this), data = self.data("roundabout"), length = self.children(data.childSelector).length; if (!data.reflect) { return ((length) - (Math.round(data.bearing / data.period) % length)) % length; } else { return (Math.round(data.bearing / data.period) % length); } }, // degToRad // converts degrees to radians degToRad: function(degrees) { return methods.normalize.apply(null, [degrees]) * Math.PI / 180.0; }, // getPlacement // returns the starting degree for a given child getPlacement: function(child) { var data = this.data("roundabout"); return (!data.reflect) ? 360.0 - (data.period * child) : data.period * child; }, // isInFocus // is this roundabout currently in focus? isInFocus: function(degrees) { var diff, self = this, data = self.data("roundabout"), bearing = methods.normalize.apply(null, [data.bearing]); degrees = methods.normalize.apply(null, [degrees]); diff = Math.abs(bearing - degrees); // this calculation gives a bit of room for javascript float rounding // errors, it looks on both 0deg and 360deg ends of the spectrum return (diff <= data.floatComparisonThreshold || diff >= 360 - data.floatComparisonThreshold); }, // getChildInFocus // returns the current child in focus, or false if none are in focus getChildInFocus: function() { var data = $(this).data("roundabout"); return (data.childInFocus > -1) ? data.childInFocus : false; }, // compareVersions // compares a given version string with another compareVersions: function(baseVersion, compareVersion) { var i, base = baseVersion.split(/\./i), compare = compareVersion.split(/\./i), maxVersionSegmentLength = (base.length > compare.length) ? base.length : compare.length; for (i = 0; i <= maxVersionSegmentLength; i++) { if (base[i] && !compare[i] && parseInt(base[i], 10) !== 0) { // base is higher return 1; } else if (compare[i] && !base[i] && parseInt(compare[i], 10) !== 0) { // compare is higher return -1; } else if (base[i] === compare[i]) { // these are the same, next continue; } if (base[i] && compare[i]) { if (parseInt(base[i], 10) > parseInt(compare[i], 10)) { // base is higher return 1; } else { // compare is higher return -1; } } } // nothing was triggered, versions are the same return 0; } }; // start the plugin $.fn.roundabout = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === "object" || $.isFunction(method) || !method) { return methods.init.apply(this, arguments); } else { $.error("Method " + method + " does not exist for jQuery.roundabout."); } }; })(jQuery); /** * jQuery Roundabout Shapes v2 * http://fredhq.com/projects/roundabout-shapes/ * * Provides additional paths along which items can move for the * jQuery Roundabout plugin (v1.0+). * * Terms of Use // jQuery Roundabout Shapes * * Open source under the BSD license * * Copyright (c) 2009-2011, Fred LeBlanc * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * - Neither the name of the author nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ jQuery.extend(jQuery.roundaboutShapes, { theJuggler: function(r, a, t) { return { x: Math.sin(r + a), y: Math.tan(Math.exp(Math.log(r)) + a) / (t - 1), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, figure8: function(r, a, t) { return { x: Math.sin(r * 2 + a), y: (Math.sin(r + Math.PI/2 + a) / 8) * t, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, waterWheel: function(r, a, t) { return { x: (Math.sin(r + Math.PI/2 + a) / 8) * t, y: Math.sin(r + a) / (Math.PI/2), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, square: function(r, a, t) { var sq_x, sq_y, sq_z; if (r <= Math.PI/2) { sq_x = (2/Math.PI) * r; sq_y = -(2/Math.PI) * r + 1; sq_z = -(1/Math.PI) * r + 1; } else if (r > Math.PI/2 && r <= Math.PI) { sq_x = -(2/Math.PI) * r + 2; sq_y = -(2/Math.PI) * r + 1; sq_z = -(1/Math.PI) * r + 1; } else if (r > Math.PI && r <= (3 * Math.PI) / 2) { sq_x = -(2/Math.PI) * r + 2; sq_y = (2/Math.PI) * r - 3; sq_z = (1/Math.PI) * r - 1; } else { sq_x = (2/Math.PI) * r - 4; sq_y = (2/Math.PI) * r - 3; sq_z = (1/Math.PI) * r - 1; } return { x: sq_x, y: sq_y * t, z: sq_z, scale: sq_z }; }, conveyorBeltLeft: function(r, a, t) { return { x: -Math.cos(r + a), y: (Math.cos(r + 3*Math.PI/2 + a) / 8) * t, z: (Math.sin(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, conveyorBeltRight: function(r, a, t) { return { x: Math.cos(r + a), y: (Math.cos(r + 3*Math.PI/2 + a) / 8) * t, z: (Math.sin(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, goodbyeCruelWorld: function(r, a, t) { return { x: Math.sin(r + a), y: (Math.tan(r + 3*Math.PI/2 + a) / 8) * (t + 0.5), z: (Math.sin(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, diagonalRingLeft: function(r, a, t) { return { x: Math.sin(r + a), y: -Math.cos(r + Math.tan(Math.cos(a))) / (t + 1.5), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, diagonalRingRight: function(r, a, t) { return { x: Math.sin(r + a), y: Math.cos(r + Math.tan(Math.cos(a))) / (t + 1.5), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, rollerCoaster: function(r, a, t) { return { x: Math.sin(r + a), y: Math.sin((2 + t) * r), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, tearDrop: function(r, a, t) { return { x: Math.sin(r + a), y: -Math.sin(r/2 + t) + 0.35, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, tickingClock: function(r, a, t) { return { x: Math.cos(r + a - Math.PI/2), y: Math.sin(r + a - Math.PI/2), z: Math.cos(r), scale: Math.cos(r) + 0.5 } }, flurry: function(r, a, t) { return { x: Math.sin(r * 3 + a), y: (Math.cos(r + Math.PI/2 + a) / 2) * t, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, nowSlide: function(r, a, t) { return { x: Math.tan(r * 2 + a) * 0.5, y: Math.cos(r*2 + t) / 6, z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; }, risingEssence: function(r, a, t) { return { x: Math.sin(r + a), y: Math.tan((2 + t) * r), z: (Math.cos(r + a) + 1) / 2, scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5 }; } }); jQuery.fn.jqShutters = function(options){ var defaults = { MainList:".list ul li", EleWin:100,//姣忓垪鏄剧ず鐨勫搴� DelayTime:300, }; var opts = jQuery.extend(defaults,options); return this.each(function(){ //jqShutters 寮€濮� _this=jQuery(this); InfoWin=_this.width()-$(_this).find(opts.MainList).length*opts.EleWin;//鑾峰彇鍓╀笅鐨勫搴� if(InfoWin<=0){ return; }; $(_this).find(opts.MainList).width(opts.EleWin+InfoWin); $(_this).find(opts.MainList).parent().css({"overflow":"hidden","position":"relative"}) $(_this).find(opts.MainList).each(function(e) { $(this).css({"left":e*opts.EleWin+InfoWin,"position":"absolute"}); }); $(_this).find(opts.MainList).eq(0).css("left",0).addClass("on"); $(_this).find(opts.MainList).hover(function(){ _index=$(this).index(); $(this).addClass("on").siblings().removeClass("on"); $(this).stop(false,false).animate({"left":_index*opts.EleWin},opts.DelayTime); $(this).siblings("li").each(function() { if($(this).index()<=_index){ $(this).stop(true,false).animate({"left":$(this).index()*opts.EleWin},opts.DelayTime).next(); }else{ $(this).stop(true,false).animate({"left":$(this).index()*opts.EleWin+InfoWin},opts.DelayTime); } }); }); //jqShutters 缁撴潫 }) } $(function() { $(window).scroll(function() { if($(window).scrollTop() >= 100) { $('.actGotop').fadeIn(300); } else { $('.actGotop').fadeOut(300); } }); $('.actGotop').click(function() { $('html,body').animate({ scrollTop: '0px' }, 800); }); }); $(function () { $(".hongbao1").addClass('active'); }); $(function () { $('#keft_div').hover(function(){ $('#keft_div').stop().animate({right:'0px'},200); },function(){ $('#keft_div').stop().animate({right:'-202px'},200); }); }) $(function(){ $('.nav_box').hover( function(){ $(this).find('b').show(); $(this).find('.inbox').show(); }, function(){ $(this).find('b').hide(); $(this).find('.inbox').hide(); } ); $('.nav_box').each(function(index, element) { $(this).find('span').eq(1).css({color:'#fff'}); }).last().css({'border-right':'none'}); $('#footer').corner('4px'); if($('#gla')){ $('.gla_inbox').corner('8px'); $('#gla_box>ul').roundabout({ minOpacity:1, btnNext: ".next", duration: 1000, reflect: true, btnPrev: '.prev', autoplay:true, autoplayDuration:5000, tilt:0, shape: 'figure8' }); } $('#sidebar li').eq(0).css({'border-top-color':''}); $('#sidebar li').each(function(index){ $(this).hover( function(){ $(this).addClass('li_hover').find('a').css({'color':'#03F'}); }, function(){ $(this).removeClass('li_hover').find('a').css({'color':'#fff'}); } ); }); $('.con li:even').css({'background':'#f8fbfc'}); }); /*! * jQuery corner plugin: simple corner rounding * Examples and documentation at: http://jquery.malsup.com/corner/ * version 2.12 (23-MAY-2011) * Requires jQuery v1.3.2 or later * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * Authors: Dave Methvin and Mike Alsup */ /** * corner() takes a single string argument: $('#myDiv').corner("effect corners width") * * effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). * corners: one or more of: top, bottom, tr, tl, br, or bl. (default is all corners) * width: width of the effect; in the case of rounded corners this is the radius. * specify this value using the px suffix such as 10px (yes, it must be pixels). */ ;(function($) { var style = document.createElement('div').style, moz = style['MozBorderRadius'] !== undefined, webkit = style['WebkitBorderRadius'] !== undefined, radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined, mode = document.documentMode || 0, noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8), expr = $.browser.msie && (function() { var div = document.createElement('div'); try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); } catch(e) { return false; } return true; })(); $.support = $.support || {}; $.support.borderRadius = moz || webkit || radius; // so you can do: if (!$.support.borderRadius) $('#myDiv').corner(); function sz(el, p) { return parseInt($.css(el,p))||0; }; function hex2(s) { s = parseInt(s).toString(16); return ( s.length < 2 ) ? '0'+s : s; }; function gpc(node) { while(node) { var v = $.css(node,'backgroundColor'), rgb; if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') { if (v.indexOf('rgb') >= 0) { rgb = v.match(/\d+/g); return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]); } return v; } if (node.nodeName.toLowerCase() == 'html') break; node = node.parentNode; // keep walking if transparent } return '#ffffff'; }; function getWidth(fx, i, width) { switch(fx) { case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width)))); case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width)))); case 'sharp': return width-i; case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width)))); case 'slide': return Math.round(width*(Math.atan2(i,width/i))); case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1)))); case 'curl': return Math.round(width*(Math.atan(i))); case 'tear': return Math.round(width*(Math.cos(i))); case 'wicked': return Math.round(width*(Math.tan(i))); case 'long': return Math.round(width*(Math.sqrt(i))); case 'sculpt': return Math.round(width*(Math.log((width-i-1),width))); case 'dogfold': case 'dog': return (i&1) ? (i+1) : width; case 'dog2': return (i&2) ? (i+1) : width; case 'dog3': return (i&3) ? (i+1) : width; case 'fray': return (i%2)*width; case 'notch': return width; case 'bevelfold': case 'bevel': return i+1; case 'steep': return i/2 + 1; case 'invsteep':return (width-i)/2+1; } }; $.fn.corner = function(options) { // in 1.3+ we can fix mistakes with the ready state if (this.length == 0) { if (!$.isReady && this.selector) { var s = this.selector, c = this.context; $(function() { $(s,c).corner(options); }); } return this; } return this.each(function(index){ var $this = $(this), // meta values override options o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(), keep = /keep/.test(o), // keep borders? cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]), // corner color sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]), // strip color width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10, // corner width re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/, fx = ((o.match(re)||['round'])[0]), fold = /dogfold|bevelfold/.test(o), edges = { T:0, B:1 }, opts = { TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o), BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o) }, // vars used in func later strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz; if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR ) opts = { TL:1, TR:1, BL:1, BR:1 }; // support native rounding if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) { if (opts.TL) $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px'); if (opts.TR) $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px'); if (opts.BL) $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px'); if (opts.BR) $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px'); return; } strip = document.createElement('div'); $(strip).css({ overflow: 'hidden', height: '1px', minHeight: '1px', fontSize: '1px', backgroundColor: sc || 'transparent', borderStyle: 'solid' }); pad = { T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0, B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0 }; if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE if (!keep) this.style.border = 'none'; strip.style.borderColor = cc || gpc(this.parentNode); cssHeight = $(this).outerHeight(); for (j in edges) { bot = edges[j]; // only add stips if needed if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none'); d = document.createElement('div'); $(d).addClass('jquery-corner'); ds = d.style; bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); if (bot && cssHeight != 'auto') { if ($.css(this,'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.bottom = ds.left = ds.padding = ds.margin = '0'; if (expr) ds.setExpression('width', 'this.parentNode.offsetWidth'); else ds.width = '100%'; } else if (!bot && $.browser.msie) { if ($.css(this,'position') == 'static') this.style.position = 'relative'; ds.position = 'absolute'; ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; // fix ie6 problem when blocked element has a border width if (expr) { bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth'); ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"'); } else ds.width = '100%'; } else { ds.position = 'relative'; ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'; } for (i=0; i < width; i++) { w = Math.max(0,getWidth(fx,i, width)); e = strip.cloneNode(false); e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px'; bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild); } if (fold && $.support.boxModel) { if (bot && noBottomFold) continue; for (c in opts) { if (!opts[c]) continue; if (bot && (c == 'TL' || c == 'TR')) continue; if (!bot && (c == 'BL' || c == 'BR')) continue; common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor }; $horz = $('
').css(common).css({ width: width + 'px', height: '1px' }); switch(c) { case 'TL': $horz.css({ bottom: 0, left: 0 }); break; case 'TR': $horz.css({ bottom: 0, right: 0 }); break; case 'BL': $horz.css({ top: 0, left: 0 }); break; case 'BR': $horz.css({ top: 0, right: 0 }); break; } d.appendChild($horz[0]); var $vert = $('
').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' }); switch(c) { case 'TL': $vert.css({ left: width }); break; case 'TR': $vert.css({ right: width }); break; case 'BL': $vert.css({ left: width }); break; case 'BR': $vert.css({ right: width }); break; } d.appendChild($vert[0]); } } } } }); }; $.fn.uncorner = function() { if (radius || moz || webkit) this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0); $('div.jquery-corner', this).remove(); return this; }; // expose options $.fn.corner.defaults = { useNative: true, // true if plugin should attempt to use native browser support for border radius rounding metaAttr: 'data-corner' // name of meta attribute to use for options }; })(jQuery); 链接链接日日夜夜精品视频链接兔子先生与优奈第3期dy69.live链接链接