jQuery实现左右切换焦点图

2020-05-16 18:44:21易采站长站整理

演示图:

代码:


$(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<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=='LI')
{
node.onmouseover=function()
{
this.className+=' over';
}
node.onmouseout=function()
{
this.className=this.className.replace(' over', '');
}
}
}
}
}

/*-------------------------------------------
IE6 CSS Main Nav Dropdowns
-------------------------------------------*/
function ieDropdownsFilter() {
if(document.all&&document.getElementById)
{
navRoot = document.getElementById('filter-drop');
if (!navRoot) { return false; }

for(i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=='DIV')
{
node.onmouseover=function()
{
this.className+=' over';
}
node.onmouseout=function()
{
this.className=this.className.replace(' over', '');
}
}
}
}
}

/*-------------------------------------------
View More
-------------------------------------------*/
function itemViewer() {
//$(document).delegate('#filter-drop a, .expandable > .load, .filter-nav a', 'click', function (e)
//$(document).delegate('.expandable > .load, .filter-nav a', 'click', function (e)