Click to See Complete Forum and Search --> : Another Mouse Problem Pleas Help.
crypto
10-23-2003, 09:35 PM
:confused:Can some one help me please.:confused:
1 - I have on my site a pic that links to another page when you click down on it but the mouse changes to that hand pointer can anyone tell me the code to stop that from happening so on mouse over its the normal mouse pointer that the person uses on their computer.
2 - And if its posible i only want the link to work if your holding down controle and shift at the same time then click on it. Please.
If you could give me both seperate codes and/or one lot of code with both parts in it I would be very greatfull.
Thankyou.
..........
Crypto....:cool:
crypto
10-24-2003, 03:14 AM
Ok I got the curser fixed up but still i can't get it well i don't know how to make it so you have to press control and shift befor clicking on it.
Can some one please help me with this.
The mouse curser line is :-
<a onMouseOver="style.cursor='default'"><img scr="x" width="x" hight="x" border="x"></a>
Very simple realy. LOL.
Gollum
10-24-2003, 04:08 AM
First thing, you don't need the onmouseover to change the cursor. Just set the cursor to whatever and it will only affect the cursor while the mouse is over the element.
OK, now for ctrl-shift...
<body onkeydown="keyDown(event);"
<a style="cursor:default;" onclick="DoClick(this.event);"><img ...></a>
<script>
function DoClick(oA, e)
{
var evt = e ? e : (event ? event : null);
if ( !evt )
{
// don't know how so let them go...
oA.href = "www.gothere.com";
}
else if ( evt.modifiers != undefined )
{
// NN4
var m = Event.CONTROL_MASK | Event.SHIFT_MASK;
if ( e.modifiers & m == m ) oA.href = "www.gothere.com";
}
else if ( evt.ctrlKey && evt.shiftKey )
{
// IE & NN6
oA.href = "www.gothere.com";
}
}
</script>
crypto
10-24-2003, 04:22 AM
Ok thanks for that, but it keeps on comming up with a run time error. Sorry I'm verry new to js I just started using it last night but im learning quickly cause its not that different from C and C++. So what would I have to change to make it work? Obviousley I changed and used my file path for the pic, and the first www.gothere.com to my no access page and the second two www.gothere.com's to the page I want to get to by all of this. But is there anything wlse please?
Gollum
10-24-2003, 04:34 AM
D'OH! I forgot to remove the onkeydown event handler in the <body> tag. Is that your problem?
crypto
10-24-2003, 04:37 AM
It's is now saying that line 12
oA.href = "LoginPage.htm";
Erorr: 'undefined' is null or not an object. Do i remove all the o's fromthe oA's?
Gollum
10-24-2003, 04:50 AM
I need more sleep at night :(
the bit where I said...
<a style="cursor:default;" onclick="DoClick(this.event);"><img ...></a>
I should have put a comma between the 'this' and the 'event' instead of a dot.
crypto
10-24-2003, 05:01 AM
Yeah I know what you mean i didnt get any sleep last night too buizzy learning or trying to about this stuff. Thank you it now works and I have another question on a diferent thread under:-
how can you create a file using s script
if you can answer that question i would be most greatfull theres more on the problem in the tread. Thankyou.