开发者

dynamic controls using client side processing

I created a variable number of thumbs (images) and put them on a panel in a aspx code behind.

On the client I have onClick, mouseover, mouseout functions that I do hit.

I can get a reference to the individual control but I can't seem to turn the borders off and on.

I put a class in the code behind Public Overrides Property BorderWidth that will work on the server - I can put borders on all the images. 开发者_运维问答

What I want is to only have the border on mouseover.

I guess the Overrides only works on the server - tell me I wrong. In lieu of that I am trying to put a bordered div around the thumb but here again I cant seem to get the position of the object (object.style.left) with JS like I can with other 'client side controls'.

Also I saw some where that you can reference JS objects with ObjectID_data the name JS gives the object?? I don't know and cant seem to find any info.

I am new to both asp and JS. Any illumination on any topic will be appreciated.


you can set the border on onmouseover,onmouseout easily by using CSS and javascript. Lets suppose if you have following html and CSS

.borderOn {border:2px solid #EEEEE}
.borderOff {border:0px}


<div onmouseover="toggle(this);" onmouseout="toggle(this)"></div>


function toggle(div){
if(div.className == "borderOn")
  div.className="borderOff";
else
  div.className = "borderOn";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜