I'd like to re-write the following code using 'this', instead of the way it is now which refs the class. Currently the way it's written it accesses several divs at once, even though the user doesn't see them, which i'm sure is not good coding.
I'm trying to do this non-obtrusively, i.e, not put an event handler in the HTML. so not sure if it's even possible to do, ie, write a function using 'this' non-obtrusively.
(using jQuery btw)
to be clear, mousing over one div displays another div. and mousing out, then hides it. have had trouble using jQuery's toggle function in the past so i'm not using here.
it may be more complicated than it seems, as "this" always refers to the element/object/whatever that invokes it, so in this case it will refer to the div with the '.info-bar' class, and the divs with the '.theinfo' class cannot intrinsically be accessed from there.
but if your html has a reliably consistent structure, you can use "this" to access another element by seeing how the two are related in the DOM. Firebug's DOM inspector is good for this - it's hard to say without seeing your html, but the relevant div might be accessible as this.childNodes or this.firstElementChild or this.nextSibling or this.lastChild, etc (or whatever their equivalents in jQuery are).
have a look, and if you can't find it, post a sample of your html showing how the two divs relate to each other structure-wise.