";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "
";
document.write(html);
}
//Attach the behaviors and the cursor
function starAttach()
{
for(var i=1;i<11;i++)
{
document.getElementById("star"+this.id+"_"+i).style.cursor="pointer";
document.getElementById("star"+this.id+"_"+i).onmouseover= moveStarPoint;
document.getElementById("star"+this.id+"_"+i).onmouseout= outStarPoint;
document.getElementById("star"+this.id+"_"+i).starid= this.id;
document.getElementById("star"+this.id+"_"+i).onclick= setStarPoint;
}
}
//dettach the behaviors and the cursor
function starDeAttach()
{
for(var i=1;i<11;i++)
{
document.getElementById("star"+this.id+"_"+i).style.cursor="default";
document.getElementById("star"+this.id+"_"+i).onmouseover = null;
document.getElementById("star"+this.id+"_"+i).onmouseout = null;
document.getElementById("star"+this.id+"_"+i).onclick= null;
}
}
//redraw the stars
function starRedraw(point)
{
this.point = point;
if(parseInt(point)!=point) pointp = parseInt(point)+0.5;
else pointp = point;
var point2 = pointp*2;
for(var i=1;i<11;i++)
{
if(i<= point2)
if(parseInt(i/2)*2==i)
document.getElementById("star"+this.id+"_"+i).src = this.star_on_right;
else
document.getElementById("star"+this.id+"_"+i).src = this.star_on_left;
else
if(parseInt(i/2)*2==i)
document.getElementById("star"+this.id+"_"+i).src = this.star_off_right;
else
document.getElementById("star"+this.id+"_"+i).src = this.star_off_left;
}
document.getElementById("show_"+this.id).innerHTML = parseFloat(point).toFixed(1);
}
/** Usage:
var star1 = new star5("s1");
star1.initial();
star1.attach();
star1.redraw(1);
**/
/************** end of class star5 *****************************/
//The onmousemove method
function moveStarPoint(evt)
{
var pstar = evt?evt.target:event.toElement;
var point = pstar.getAttribute("point");
var starobj = new star5(pstar.starid);
starobj.redraw(point);
}
function outStarPoint(evt)
{
var pstar = evt?evt.target:event.srcElement;
var starobj = new star5(pstar.starid);
starobj.redraw(0);
}
//The onclick method,and post the fields
function setStarPoint(evt)
{
var pstar = evt?evt.target:event.srcElement;
var starobj = new star5(pstar.starid);
starobj.deattach();
//set the form. value
document.getElementById(pstar.starid).value = pstar.getAttribute("point");;
}
//-->
var xajaxRequestUri="index.php?gOo=get_review_list.php";
显示: 查找:
0条评论0/0页
请先点此登录再进行评论
请先点击星标为该商品评分!";
return false;
}
}
}
return true;
}
//-->
";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "";
html += "
";
document.write(html);
}
//Attach the behaviors and the cursor
function starAttach()
{
for(var i=1;i<11;i++)
{
document.getElementById("star"+this.id+"_"+i).style.cursor="pointer";
document.getElementById("star"+this.id+"_"+i).onmouseover= moveStarPoint;
document.getElementById("star"+this.id+"_"+i).onmouseout= outStarPoint;
document.getElementById("star"+this.id+"_"+i).starid= this.id;
document.getElementById("star"+this.id+"_"+i).onclick= setStarPoint;
}
}
//dettach the behaviors and the cursor
function starDeAttach()
{
for(var i=1;i<11;i++)
{
document.getElementById("star"+this.id+"_"+i).style.cursor="default";
document.getElementById("star"+this.id+"_"+i).onmouseover = null;
document.getElementById("star"+this.id+"_"+i).onmouseout = null;
document.getElementById("star"+this.id+"_"+i).onclick= null;
}
}
//redraw the stars
function starRedraw(point)
{
this.point = point;
var point2 = point*2;
for(var i=1;i<11;i++)
{
if(i<= point2)
if(parseInt(i/2)*2==i)
document.getElementById("star"+this.id+"_"+i).src = this.star_on_right;
else
document.getElementById("star"+this.id+"_"+i).src = this.star_on_left;
else
if(parseInt(i/2)*2==i)
document.getElementById("star"+this.id+"_"+i).src = this.star_off_right;
else
document.getElementById("star"+this.id+"_"+i).src = this.star_off_left;
}
document.getElementById("show_"+this.id).innerHTML = parseFloat(point).toFixed(1);
}
/** Usage:
var star1 = new star5("s1");
star1.initial();
star1.attach();
star1.redraw(1);
**/
/************** end of class star5 *****************************/
//The onmousemove method
function moveStarPoint(evt)
{
var pstar = evt?evt.target:event.toElement;
var point = pstar.getAttribute("point");
var starobj = new star5(pstar.starid);
starobj.redraw(point);
}
function outStarPoint(evt)
{
var pstar = evt?evt.target:event.srcElement;
var starobj = new star5(pstar.starid);
starobj.redraw(0);
}
//The onclick method,and post the fields
function setStarPoint(evt)
{
var pstar = evt?evt.target:event.srcElement;
var starobj = new star5(pstar.starid);
starobj.deattach();
//set the form. value
document.getElementById(pstar.starid).value = pstar.getAttribute("point");;
}
//-->