jQuery实现左右切换焦点图

演示图:

jQuery实现左右切换焦点图_第1张图片

代码:

$(document).ready(function() {   
  greyInitRedux();
  ieDropdownsNav();
  ieDropdownsFilter();
  itemViewer();
  jsTabsetInit();
  slider();
  headerTabs();
  carousel();
  emergencyClose();
  replyLinks();
  adjournLinks();
  zebra_strip_rows();
  visitor_site_slideshow();
 });
 
var carousel_round = 0;
 
/*-------------------------------------------
  Grey Initial Values
-------------------------------------------*/
function greyInitRedux() {
  $("input.filled, textarea.filled").focus(function(e){
    if(this.value == this.defaultValue)
    {
      $(this).removeClass('filled');
       this.value= '';
    }
    $(this).blur(function(f){ 
      if(this.value == this.defaultValue) {
        $(this).addClass('filled');
        } else if(this.value == "") {
          this.value = this.defaultValue;
          $(this).addClass('filled');
        }
      });
  })
 
}
   
/*-------------------------------------------
  IE6 CSS Main Nav Dropdowns
-------------------------------------------*/
function ieDropdownsNav() {
  if(document.all&&document.getElementById) 
  {
    navRoot = document.getElementById('main-nav');
    if (!navRoot) { return false; }
     
    for(i=0; i .load, .filter-nav a', 'click', function (e)
  //$(document).delegate('.expandable > .load, .filter-nav a', 'click', function (e)
  $(document).delegate('.filter-nav a', 'click', function (e) 
  {
    // get the src for the content we're trying to view
    var dataSrc = $(this).attr('data-src');
     
    // determine whether we're trying to sort the existing view
    if($(this).attr('data-sort')) {
      var dataSort = $(this).attr('data-sort');
    } else {
      var dataSort = $('.filter-nav > li > a').attr('data-sort');
    }
 
    // 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($(this).closest('div').hasClass("filter"))
    {
      var hiddenDiv = $('
', { "class": "items hidden spacer", "height": $('.expandable').outerHeight() }); $('.expandable > .load').before(hiddenDiv); $('.expandable > ul, .expandable > div:not(.spacer)').remove(); $('.load').attr('data-src',dataSrc); // Change Class of Dropdown Toggle var clickedClass = $(this).parent().attr('class'); $("#filter-drop strong").removeClass().addClass(clickedClass); // Change Text of Dropdown Toggle var thisLabel = $(this).text(); $("#filter-drop strong span").text(thisLabel); // Grab datasrc from clicked-on menu item and populate the filters with it $('.filter-nav a').attr('data-src' , dataSrc); $('.filter-nav li').removeClass('active'); $('.filter-nav > li').eq(0).addClass('active'); } //find out if we clicked the filter nav, if so let's switch the active class if($(this).closest('ul').hasClass("filter-nav")) { $('.filter-nav li').removeClass('active'); $(this).parent().addClass('active'); //Also let's remove all the items before replacing them with what we want var hiddenDiv = $('
', { "class": "items hidden spacer", "height": $('.expandable').outerHeight() }); $('.expandable > .load').before(hiddenDiv); $('.expandable > ul, .expandable > div:not(.spacer)').remove(); } $.get(dataSrc, { offset: itemOffset, sort: dataSort }, function(data) { $('.expandable .spacer').remove(); var hiddenDiv = $(''); $('.expandable > .load').before(hiddenDiv); $(hiddenDiv).append(data).hide().removeClass("hidden").fadeIn(); }); e.preventDefault(); }); } function jsTabsetInit() { var $tabset = $('.heading-tabset').eq(0); var $tablist = $('

以上所述就是本文的全部内容了,希望大家能够喜欢。

你可能感兴趣的:(jQuery实现左右切换焦点图)