views:

95

answers:

1

Possible Duplicate:
what does #someDiv mean?

i am doing this:

onmouseover="evt.target.setAttribute('opacity', '0.5'); $('#someDiv').show();" onmouseout="evt.target.setAttribute('opacity','1)'); $('#someDiv').hide();"

but i guess i need something called an ID selector?

anyway how do i make it so that when there is a mouseover the object, i get a little popup ?

+1  A: 

$('#someDiv') is selecting the element with ID="someDiv", so selectors might not be your problem.

Apart from using the onmouseover event attribute, the code you provided should basically work. Are you seeing any JS errors, or have other debug results you could share?

Edit:

It's probably (maybe?) unrelated to your problem, but you should consider moving all the JS logic to a linked JS file instead of using the onmouseover property. jQuery's $('#your-selector').mouseover() method is a much better way to handle this. (http://api.jquery.com/mouseover/)

anschauung
there are no errors, the code just doesnt pop up any texdt, but it does change the opacity nicely
I__
I don't think the code will work, because "evt" is not going to be defined. He needs to move that code to an event handler set up via jQuery, as you suggest.
Pointy
Are you 100%, definitely, and absolutely sure that the <div id="someDiv"> element is present in the markup and visible?
anschauung
@Pointy: Yeah, but if the opacity change is occurring the event is at least firing correctly. I suppose the onmouseover might be effecting jQuery maybe, but I can't speak to that either way, having not used onmouseover since 2001 :p
anschauung
well the problem is that it looks like that code was copy/pasted from somewhere, some code where "evt" ws declared as the argument to a jQuery handler function. If it's just stuffed in as the value of "onclick", it absolutely will not work.
Pointy