/*window.onload = function () {
Get all tab tabs
var tabs = document.getElementById ("Tabsmin"). getElementsByTagName ("Li");
var contents = document.getElementById ("Newbooks_main"). getElementsByTagName ("div");
for (var i = 0;i<tabs.length;i++) {
Tabs[i].index = i;
Tabs[i].onmouseover = function () {
for (var j = 0;j<tabs.length;j++) {
Tabs[j].classname = "";
Contents[j].style.display = "None";
};
This.classname = "cur";
Contents[this.index].style.display = "block";
};
}
};*/
$ (function () {
/* Latest Shelves tab Toggle Effect */
$ ("#tabsMin li"). MouseOver (function () {
$ (this). AddClass ("cur"). Siblings (). Removeclass ("cur");
$ ("Div. Booksort"). Hide (). EQ ($ (this). Index ()). Show ();
});
Timer
var nowrow=0;
Function times () {
if (nowrow==$ ("#focus li"). length) nowrow=0;
$ ("#focus li"). EQ (nowrow). addclass ("cur"). Siblings (). Removeclass ("cur");
$ ("#focusimg"). attr ("src", "Images/dd_scroll_" + (nowrow+1) + ". jpg");
nowrow++;
}
var time=setinterval (times,1000);
Slide
$ ("#focus li"). MouseOver (function () {
$ (this). AddClass ("cur"). Siblings (). Removeclass ("cur");
$ ("#focusimg"). attr ("src", "Images/dd_scroll_" + ($ (this). Index () +1) + ". jpg");
Clearinterval (time);
});
$ ("#focus li"). Mouseout (function () {
Time=setinterval (times,1000);
});
Floating ads
$ ("#right"). css ({"Position": "Fixed", "Top": "100px"});
Turn off floating ads
$ ("#dd_close"). Click (function () {
$ (this). Parent (). Hide ();
});
/* Ads with mouse scrolling on the right image
var Rightt;
var rightr;
var objright;
var rightwidth;
function Place () {
Objright=document.getelementbyid ("right");
Rightwidth=document.getelementbyid ("right1"). Width;
if (objright.currentstyle) {//ie browser
Rightt=parseint (ObjRight.currentStyle.top);
Rightr=parseint (ObjRight.currentStyle.right);
}
Else{//firefox Browser
Rightt=parseint (Document.defaultView.getComputedStyle (objright,null). top);
Rightr=parseint (Document.defaultView.getComputedStyle (objright,null). right);
}
}
function Move () {
Objright.style.top=rightt+parseint (Document.documentElement.scrollTop + document.body.scrollTop) + "px";
Objright.style.left=parseint (document.documentelement.scrollleft+document.body.scrollleft) +parseInt ( Document.documentElement.clientWidth)-rightr-rightwidth+ "px";
document.getElementById ("Dd_close"). style.left= "63px";
}
Place ();
Window.onscroll=move;
The right side of the image to scroll with the mouse off
Objright.onclick=function () {
Objright.style.display= "None";
}*/
Drop-down menu
$ ("[alt= ' Arrow ']"). Parent (). Hover (
function () {
$ ("#dd_menu_top_down"). Show ();
},
function () {
$ ("#dd_menu_top_down"). Hide ();
}
);
Auto-scrolling Ads
$ ("#dome2"). HTML ($ ("#dome1"). html ());
function Timee () {
if ($ ("#dome2") [0].offsettop-$ ("#dome") [0].scrolltop<=0) {
$ ("#dome") [0].scrolltop-=$ ("#dome1") [0].offsetheight
}else{
$ ("#dome") [0].scrolltop++;
}
}
var start=setinterval (timee,1)
$ ("#dome"). Hover (
function () {
Clearinterval (start);
},
function () {
Start=setinterval (timee,1)
}
);
});
About the JS code of Dangdang