cursor lost it hand

L

lenbell

Hi All

I have a few

onclick="javascript:poptastic('http://dominatesoftware.com/main.php','height=430,width=400,resizable=1,scrollbars=1,toolbar=1');"

calls in several html files. The function looks like this
var newwindow;
function poptastic(url,stuff)
{
newwindow=window.open(url,'name',stuff);
if (window.focus) {newwindow.focus()}
}

My problem is the cursor doesn't change to the hand so my users may not
realize there is a link there. I think it is because the javascript doesn't
produce a HREF tag

Is there some way to get a onmouseover thingy to fix this

Yes I'm new to javascript

Len Bell
 
E

Evertjan.

lenbell wrote on 27 mei 2008 in comp.lang.javascript:
Hi All

I have a few

onclick="javascript:poptastic('http://dominatesoftware.com/main.php','h
eight=430,width=400,resizable=1,scrollbars=1,toolbar=1');"

the javascript: part is nonsense, trow it avaw.

calls in several html files. The function looks like this
var newwindow;
function poptastic(url,stuff)
{
newwindow=window.open(url,'name',stuff);
if (window.focus) {newwindow.focus()}
}

My problem is the cursor doesn't change to the hand so my users may
not realize there is a link there. I think it is because the
javascript doesn't produce a HREF tag

Should it?
You firat have to produce an html element that understands href=.
href is not a tag, btw.
Is there some way to get a onmouseover thingy to fix this

Yes I'm new to javascript

Better read up on CSS styles, that's where you change the cursor.
 
L

lenbell

Evertjan. said:
lenbell wrote on 27 mei 2008 in comp.lang.javascript:


the javascript: part is nonsense, trow it avaw.



Should it?
You firat have to produce an html element that understands href=.
href is not a tag, btw.


Better read up on CSS styles, that's where you change the cursor.

Not really a CSS problem at all. I don't want it to change cursors on every
image, just the ones that have this "poptastic" attached to the onClick
event

The problem is that the html has no HREF tag so it does not change the cusor
shape to the hand - indicating a link.

I need and can not find a javascript to attach to the onMouseOver event

Len Bell
 
G

Gregor Kofler

lenbell meinte:

Please don't quote signatures.
Not really a CSS problem at all. I don't want it to change cursors on every
image, just the ones that have this "poptastic" attached to the onClick
event

The problem is that the html has no HREF tag so it does not change the cusor
shape to the hand - indicating a link.

I need and can not find a javascript to attach to the onMouseOver event

Huh?

onmouseover="this.style.cursor='pointer'"

Gregor
 
T

Thomas 'PointedEars' Lahn

[snipped attribution novel]
Evertjan. said:
lenbell wrote on 27 mei 2008 in comp.lang.javascript:
I have a few

onclick="javascript:poptastic('http://dominatesoftware.com/main.php','h
eight=430,width=400,resizable=1,scrollbars=1,toolbar=1');"
[...]
My problem is the cursor doesn't change to the hand so my users may
not realize there is a link there.

Because there isn't any.
I think it is because the javascript doesn't produce a HREF tag
Should it?
You firat have to produce an html element that understands href=.
href is not a tag, btw.
Is there some way to get a onmouseover thingy to fix this

Yes I'm new to javascript
Better read up on CSS styles, that's where you change the cursor.
[...]

Not really a CSS problem at all. I don't want it to change cursors on every
image, just the ones that have this "poptastic" attached to the onClick
event

Make them links; don't make the other ones links.
The problem is that the html has no HREF tag so it does not change the cusor
shape to the hand - indicating a link.

Again, `href' is not a tag. It is an attribute of `a' elements, among
others. When used with an `a' element, that makes this element a (hyper)link.

A tag instead is a part of an element: <p> is the start tag of the `p'
element, for example.

See also http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.1
I need [...] a javascript to attach to the onMouseOver event

No, you don't. Instead you need a minimum clue about HTML and client-side
scripting, and how to use both to create Web sites that degrade gracefully,
before you continue.

<script type="text/javascript">
function isMethod(o, p)
{
return o && /\b(function|object|unknown)\b/i.test(typeof o[p])
&& o[p];
}

function poptastic(url, options)
{
if (isMethod(window, "open"))
{
var w = window.open(url, "poptastic", options);
if (isMethod(w, "focus")) w.focus();
}

return !w;
}
</script>

<a href="http://dominatesoftware.com/main.php"
onclick="return poptastic(this.href,
'height=430,width=400,resizable,scrollbars,toolbar');"


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top