"Eric Layman" <erricson@layswrote in message
news:1170534204_23209@sp6iad.superfeed.net...
Quote:
>
"Randy Webb" <HikksNotAtHome@aol.comwrote in message
news:etydnUGLFJy_QFnY4p2dnA@telcove.net...
Quote:
>Eric Layman said the following on 2/4/2007 2:58 AM:
>>
>Answer:It destroys the order of the conversation
>Question: Why?
>Answer: Top-Posting.
>Question: Whats the most annoying thing on Usenet?
>>
Quote:
>>Thanks.
>>>
>>How does onmousedown and up helps?
>>
>It tells you when they hold the mouse down.
>>
Quote:
>>Don't they cancel out each other?
>>
>No. The onmousedown gets triggered, they drag the mouse, the mouse is
>released and the onmouseup gets triggered.
>>
>onmousedown="var mouseIsDown=true"
>onmousedown="var mouseIsDown=false"
>>
>And then when the mouse is being dragged/moved, you check the state of
>mouseIsDown.
>>
>Your posting agent is severely broken.
>>
>--
>Randy
>Chance Favors The Prepared Mind
>comp.lang.javascript FAQ -
http://jibbering.com/faq/index.html
>Javascript Best Practices -
>
http://www.JavascriptToolbox.com/bestpractices/ >
Thanks for the advice!
>
Here's the script I've conjured based on your tips!
>
My idea is to have multiple selection of table cells if user holds the
mouse down and "drags" the mouse over other cells.
>
But now I have problem with "deselecting" the selected cells. My logic
seems flawed here. (yes i know the html is malformed. i just wanna test
out the idea =) )
>
Any comments?
>
<script language="javascript">
var mouseIsDown = false;
>
function md()
{
mouseIsDown = true;
}
>
function mu()
{
mouseIsDown = false;
}
>
function check(cid)
{
var obj;
obj = document.getElementById(cid);
if(mouseIsDown)
{
if(obj.getAttribute('bgColor')=="blue")
{
obj.getAttributesetAttribute('bgColor','white');
}
else(obj.getAttribute('bgColor')=="white")
{
obj.setAttribute('bgColor','blue');
}
}
}
</script>
<body id="b1" >
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td id="d1" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d1');"> </td>
<td id="d2" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d2');"> </td>
</tr>
<tr>
<td id="d3" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d3');"> </td>
<td id="d4" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d4');"> </td>
</tr>
<tr>
<td id="d5" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d5');"> </td>
<td id="d6" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d6');"> </td>
</tr>
<tr>
<td id="d7" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d7');"> </td>
<td id="d8" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d8');"> </td>
</tr>
<tr>
<td id="d9" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d9');"> </td>
<td id="d10" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d10');"> </td>
</tr>
<tr>
<td id="d11" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d11');"> </td>
<td id="d12" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d12');"> </td>
</tr>
<tr>
<td id="d13" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d13');"> </td>
<td id="d14" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d14');"> </td>
</tr>
<tr>
<td id="d15" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d15');"> </td>
<td id="d16" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d16');"> </td>
</tr>
<tr>
<td id="d17" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d17');"> </td>
<td id="d18" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d18');"> </td>
</tr>
</table>
</body>
>
>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com An amended version. finally got de-selection to work:
<script language="javascript">
var mouseIsDown = false;
function md()
{
mouseIsDown = true;
}
function mu()
{
mouseIsDown = false;
}
function check(cid)
{
var obj;
obj = document.getElementById(cid);
var bgc = obj.getAttribute('bgColor');
if(mouseIsDown==true)
{
if(bgc=="")
{
obj.setAttribute('bgColor','blue');
}
else
{
obj.setAttribute('bgColor','white');
}
}
}
</script>
<body id="b1">
<div onMouseUp="mu();">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td id="d1" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d1');"> </td>
<td id="d2" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d2');"> </td>
</tr>
<tr>
<td id="d3" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d3');"> </td>
<td id="d4" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d4');"> </td>
</tr>
<tr>
<td id="d5" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d5');"> </td>
<td id="d6" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d6');"> </td>
</tr>
<tr>
<td id="d7" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d7');"> </td>
<td id="d8" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d8');"> </td>
</tr>
<tr>
<td id="d9" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d9');"> </td>
<td id="d10" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d10');"> </td>
</tr>
<tr>
<td id="d11" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d11');"> </td>
<td id="d12" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d12');"> </td>
</tr>
<tr>
<td id="d13" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d13');"> </td>
<td id="d14" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d14');"> </td>
</tr>
<tr>
<td id="d15" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d15');"> </td>
<td id="d16" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d16');"> </td>
</tr>
<tr>
<td id="d17" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d17');"> </td>
<td id="d18" onMouseDown="md();" onMouseUp="mu();"
onMouseOver="check('d18');"> </td>
</tr>
</table>
</div>
</body>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com