jQuery实现左右切换焦点图_jquery_脚本之家【澳门京葡网站】

$.ready { greyInitRedux; ieDropdownsFilter; jsTabsetInit; headerTabs; emergencyClose; adjournLinks; visitor_site_slideshow; var carousel_round = 0; /*------------------------------------------- Grey Initial Values-------------------------------------------*/function greyInitRedux() { $("input.filled, textarea.filled").focus{ if(this.value == this.defaultValue) { $.removeClass; this.value= ''; } $.blur{ if(this.value == this.defaultValue) { $.addClass; } else if { this.value = this.defaultValue; $.addClass } /*------------------------------------------- IE6 CSS Main Nav Dropdowns-------------------------------------------*/function ieDropdownsNav() { if(document.all&&document.getElementById) { navRoot = document.getElementById; if  { return false; } for(i=0; i .load, .filter-nav a', 'click', function .delegate('.expandable > .load, .filter-nav a', 'click', function .delegate('.filter-nav a', 'click', function  { // get the src for the content we're trying to view var dataSrc = $.attr; // determine whether we're trying to sort the existing view if.attr { var dataSort = $.attr; } else { var dataSort = $('.filter-nav > li > a').attr; } // how many items do we have? var itemOffset = $('.expandable .listing > li').size(); //find out if we clicked the menu, if so, clear out everything and add data attribute to the load more if.closest.hasClass { var hiddenDiv = $('', { "class": "items hidden spacer", "height": $.outerHeight; $('.expandable > .load').before; $('.expandable > ul, .expandable > div:not; $.attr; // Change Class of Dropdown Toggle var clickedClass = $.attr; $("#filter-drop strong").removeClass().addClass; // Change Text of Dropdown Toggle var thisLabel = $; $("#filter-drop strong span").text; // Grab datasrc from clicked-on menu item and populate the filters with it $.attr; $.removeClass; $.eq; } //find out if we clicked the filter nav, if so let's switch the active class if.hasClass { $.removeClass.parent; //Also let's remove all the items before replacing them with what we want var hiddenDiv = $('', { "class": "items hidden spacer", "height": $.outerHeight; $('.expandable > .load').before; $('.expandable > ul, .expandable > div:not; } $.get(dataSrc, { offset: itemOffset, sort: dataSort }, function { $('.expandable .spacer').remove(); var hiddenDiv = $; $('.expandable > .load').before; $.append.removeClass; }); e.preventDefault;} function jsTabsetInit() { var $tabset = $.eq; var $tablist = $('', {"class": "heading-tab"}); $tabset.prepend; $.each { var $anchor = $('', { "class": $, "onClick": '_gaq.push(['_trackEvent', 'Connect', 'Click', 'Head'+$+'', 3]);', "href": "#", "html": $; var $li = $; $li.append; $tablist.append; $.remove(); $('.heading-tabset:gt { $tabset.append.find.remove;} function slider.each { // As we loop through the slider items we'll document the tallest one and the left position // of each element var maxHeight = 0, lastWidth = 0; // grab the slider and make sure the overflow is hidden and it has a defined width var $slider = $; $slider.css('width', $slider.outerWidth; $slider.css('position', 'relative'); $slider.css; // store the index (or the currently "selected" slide) $slider.prop; // loop through each of the direct children $slider.find.each { // localize the child as a jQuery object var $li = $; // if this is the tallest child, document it if  > maxHeight) { maxHeight = $li.outerHeight(); } // position each child to the immediate right of its preceding sibling $li.css('position', 'absolute'); $li.css; $li.css; // update our maths so we know where to place the next sibling lastWidth+= $li.outerWidth; // set the height of the slider based on the tallest child //$slider.css; // build the previous control button and store a reference to its related slider var $previous = $('', {"class": "prev disabled", "href": "#", "text": "Previous"}); $previous.prop; // build the next control button and store a reference to its related slider var $next = $('', {"class": "next", "href": "#", "text": "Next"}); $next.prop; // build the controls div and add it to the markup var $controls = $('', {"class": "controls"}).append.append; $slider.after; $slider.prop('controls', $controls); }); // watch for clicks on the controls $.delegate('.listing + .controls .prev, .listing + .controls .next', 'click', function  { // stop our clicks from affecting the browser/url event.preventDefault(); // localize a jQuery version of the clicked link var $anchor = $; // grab the slider, that we previously stored while creating these links var $slider = $anchor.prop; // localize the index for prettier code var focusedIndex = $slider.prop; // determine what slide is focused var $focus = $slider.find.eq; // grab the width of that focused slide var widthDelta = $focus.outerWidth(); // if we clicked the next button we're moving to the left (negative values, so // multiply by -1). if ($anchor.hasClass { widthDelta *= -1; } focusedIndex += ($anchor.hasClass ? 1 : -1; // check that the upcoming movement won't push the first element too far to the right // leaving whitespace before the element if .eq.left + widthDelta > 0) { return true; } // check that the upcoming movement won't push the last element too far to the left // leaving whitespace after the element var $lastChild = $slider.find if .left + widthDelta < $slider.outerWidth() - $lastChild.outerWidth { return true; } // get all the child elements, so we can loop through them and detmine offsets based // on widths var $siblings = $slider.find; // finally loop through each child and kick off the animation $siblings.each { // we'll determine the `left` in just a second, sit tight var left = 0; // localize the child element var $li = $; // loop through each sibling and determine the new left if  { left = -$slider.outerWidth(); } if (index >= focusedIndex && index < focusedIndex + 3) { left = 219 * ; } if (index >= focusedIndex + 3) { left = $slider.outerWidth() * 2; } // start the animation $li.animate; // are we at the beginning? if (index == 0 && left == 0) { $slider.prop.find.addClass; } else if  { $slider.prop.find.removeClass; } // are we at the end? if (index == $siblings.size()-1 && left == $slider.outerWidth() - $lastChild.outerWidth { $slider.prop.find.addClass; } else if (index == $siblings.size { $slider.prop.find.removeClass; // if we got down here then we actually moved the slider, update the reference to the // focused slide $slider.prop('index', focusedIndex); });} function headerTabs(){ var $tabset = $ $tabset.find.hide(); $tabset.find.hide(); $tabset.find.eq; $.delegate('.heading-tab a', 'click', function { event.preventDefault.addClass.parent.removeClass; var index = $.prevAll.parents.find; $.parents.find.show.parents.find; $.parents.find.eq;} function carousel.delegate('.carousel .next, .carousel .previous', 'click', function { // prevent the default anchor action event.preventDefault(); // get the current carousel var $carousel = $.parents; // check if we're already in the middle of a movement if ($carousel.prop { return true; } // if we actually clicked it, then stop any running timers if  { stop; } // localize the index, so we know where we are var index = $carousel.prop; // determine if we're going forward or backward var movingForward = $.hasClass; // grab all the slides var $slides = $carousel.find; // grab the currently focused slide var $focus = $slides.eq; // figure out where're we going from here var nextObject = movingForward ? nextSlide : previousSlide; // locaalize the next div to be shown var $next = nextObject.element; // localize the index of the next element to be shown var newIndex = nextObject.index; // determine where we should place the next element so it slides from the correct side var initialLeft = movingForward ? $.outerWidth() : -$next.outerWidth(); // save the current zero position, everything will move to/from here var zeroPosition = $focus.offset().left; // determine where the focus is moving to var targetLeft = zeroPosition + (movingForward ? -$next.outerWidth() : $next.outerWidth; // we're comitted to moving now so set the flag to true so we don't duplicate animations $carousel.prop; // reset all z-indexes to 1 $slides.css; // make the currently focused slide higher than all the rest $focus.css; // setup the current slide so it can animate out $focus.css({ "position": "absolute", "top": 0, "left": zeroPosition }); // setup the next slide to slide in, moving it above the focused slide and off screen $next.css({ "opacity": 0, "position": "absolute", "top": 0, "left": initialLeft, "z-index": 3 }); // animate the current slide out $focus.animate({ "opacity": 0, "left": targetLeft }, 800); // set up what we're animating var animation = { "opacity": 1, "left": zeroPosition } // horrible ie fix if ($.browser.msie && parseInt <= 8) { delete animation.opacity; $focus.get.style.removeAttribute; $next.get.style.removeAttribute; } // animate in the next slide, then upon completion reset everything. switch it back to // relative positioning, remove our animation flag and hide the previous element $next.show().animate(animation, 800, function; $.css({ "position": "relative", "left": 0 }); // fix msie if ($.browser.msie && parseInt <= 8) { this.style.removeAttribute; } $carousel.prop; // animate the height of our carousel, because things are abosulte the box model is shot $carousel.animate({ //"min-height": $next.outerHeight; // finally update our index to reflect the current view $carousel.prop; }); $.delegate('.carousel .pause', 'click', function { // prevent the default anchor action event.preventDefault(); // localize the carousel var $carousel = $.parents; // get the current timer, if it exists var timer = $carousel.prop; // no timer? start it if  { start; } // timer? stop it else { stop; // start a new timer, additionally update the play/pause button to the correct visual state function start { timer = setInterval { $carousel.find.trigger; //N.C.: added to stop carousel after one round. var index = $carousel.prop; if ( index==0 && carousel_round > 0 ) { stop; } else if  { carousel_round++; } }, 5000); $carousel.prop; $carousel.find.removeClass; } // stop any existing timers, additionally update the play/pause button to the correct // visual state function stop { clearInterval; $carousel.prop; $carousel.find.addClass; //N.C.: added to stop carousel after one round. carousel_round = 0; } function nextSlide { var $slides = $carousel.find; if (index+1 < $slides.size { return {"index":index+1, "element":$slides.eq}; } return {"index":0, "element":$slides.eq}; } function previousSlide { var $slides = $carousel.find; if  { return {"index":index-1, "element":$slides.eq}; } return {"index":$slides.size()-1, "element":$slides.eq}; } // build the controls for inclusion into the page var $previousBtn = $('', {"class": "previous", "href": "#", "text": "Previous"}); var $playPauseBtn = $('', {"class": "play pause", "href": "#", "text": "Play/Pause"}); var $nextBtn = $('', {"class": "next", "href": "#", "text": "Next"}); var $controlsDiv = $('', {"class": "carousel-controls"}); $controlsDiv.append; $controlsDiv.append; $controlsDiv.append; // loop through each carousel and set some default properties/styles $.each { // localize the carousel to this function var $carousel = $; // set the positioning and a default height, becuase we're going to be taken out of the // flow once our animation starts $carousel.css({ "position": "relative" //"min-height": $carousel.find.eq //N.C. commented out }); // store the currently visible slide's index $carousel.prop; // hide subsequent slides $carousel.find').hide(); // append in our controls $carousel.prepend($controlsDiv.clone; // add the previous/next images $carousel.find.each { // get the previous image var $prevImage = $(previousSlide.element).find.clone(); // remove the class $prevImage.removeClass; // create a link for the previous image var $previousAnchor = $('', { "href": "#", "class": "prev-image", "html": $prevImage }); $previousAnchor.css; // add in the previous image/anchor $.before; // get the next image var $nextImage = $(nextSlide.element).find.clone(); // remove the class $nextImage.removeClass; // create a link for the previous image var $nextAnchor = $('', { "href": "#", "class": "next-image", "html": $nextImage }); $nextAnchor.css; // add in the next image/anchor $.after; // start the carousel by default start;} function emergencyClose() { //$.append('Close'); $.delegate('.emergency .close', 'click', function { event.preventDefault.parents.remove;} function replyLinks() { //$close = $('', {"class": "close", "href": "#", "text": "Close"}); $twitterWrap = $('', {"id": "twitter-wrap"}); //$twitterWrap.append; $twitter = $('', {"id": "twitter"}); $twitterWrap.append; $.append; /*twttr.anywhere { T.tweetBox({ "width": 515, "height": 133, "defaultContent": "", "onTweet": function() { $.fadeOut; $; $; _gaq.push(['trackEvent', 'Home', 'SubmitReply', 'TwitterReply', 5]); //$twitter.remove;*/ $.delegate('.link-reply', 'click', function { event.preventDefault(); //if  { $.prepend($('', {"id": "overlay"})); //} $; $.css({ "position": "fixed", "top": 200, "left": .width; if  { $.css({ "position": "absolute", "top": $.scrollTop; } $.fadeIn; $.delegate('#overlay, #twitter-wrap .close', 'click', function { event.preventDefault.fadeOut; $.fadeOut { $;} function adjournLinks(){ $.each { var headings = []; $.find.each { headings[$.attr] = $.attr; var $headings = $('', { "class": "adjoin-header" }); for (var heading in headings) { var $li = $; var $a = $('', { "href": "#", "onClick": '_gaq.push(['_trackEvent', 'SocialDirectory', 'Click', 'Head'+heading+'', 3]);', "data-show": heading, "text": heading }) $li.append; $headings.append.before; $.delegate('a[data-show]', 'click', function { // stop the default click action event.preventDefault(); // set active $.siblings.removeClass.addClass; // find the appropriate elements $('.adjoin-options *[data-heading]').hide(); $('.adjoin-options *[data-heading="'+$.attr.fadeIn; $.find.trigger;} $.ready{ var $filter = $; var $filterSpacer = $('', { "class": "filter-drop-spacer", "height": $filter.outerHeight; var $homeShield = $; var $totalHeight = $.outerHeight.outerHeight { $.scroll { if > $totalHeight ) { $homeShield.addClass; } else if ($homeShield.hasClass && $ < $totalHeight) { $homeShield.removeClass; } if (!$filter.hasClass.scrollTop.top) { $filter.css('width', $filter.width; $filter.before; $filter.addClass; } else if ($filter.hasClass.scrollTop() < $filterSpacer.offset { $filter.removeClass; $filterSpacer.remove; function get_more_home_items() { if  { jQuery("#home_items_loading").show(); jQuery.ajax({ type: 'POST', url: 'ajax/home_items', data: 'timestamp='+curr_timestamp+'&index='+views_left, dataType: 'json', success: function { jQuery("#home_items_loading").hide(); jQuery.append; curr_timestamp=data.timestamp; } }); views_left--; } var click_index = 2-views_left; _gaq.push(['_trackEvent', 'ViewMoreChannels', 'Click', 'ViewMore_'+click_index.toString; if  { jQuery; }} /*------------------------------------------- Add Zebra Strip Rows of table with class "stripe" -- Chris Traganos-------------------------------------------*/function zebra_strip_rows() { $("table.stripe tr:odd").addClass; $("table.stripe tr:even").addClass;} function visitor_site_slideshow() { /* $('.visitors_slideshow').cycle({ fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... }); */ }

jQuery实现左右切换焦点图_jquery_脚本之家【澳门京葡网站】。如上所述正是本文的全体内容了,希望大家能够赏识。

发表评论

电子邮件地址不会被公开。 必填项已用*标注