[Javascript] Code optimization

Troy III Ajnej trojani2000 at hotmail.com
Mon Aug 14 19:26:08 CDT 2006


> From: riegel at clearimageonline.com> Subject: Re: [Javascript] Code optimization> Date: Mon, 14 Aug 2006 17:52:43 -0400> To: javascript at LaTech.edu> > Hello,> > I need some help creating an 2 onclick events for a div. You can see  > my sample code at:> > http://clearimageonline.com/projects/filebrowser/filebrowser.html> > If you look at the page listed above you can see my markup has been  > simplified to a div and many child div's. I am using javascript to  > create the contents of the div's, It works as expect so far. What I  > would like to do is create an event for clicking on the resulting  > image and a separate event for clicking on the text. Also as a side  > note is there a way to make the mouse look like it is hovering a link  > instead of text?> > Thanks for any help. > Terry
 
I like the looks of it. Nice icons. Nice item-selected color. Nicely handled click & dblclick.
Yes, the text cursor looks ugly. But two "onclick" events? You don't need that!
 
Not sure if I really understand your demand but certainly:
What you need is, one "click" event, handling two separate/different functions at best.
 
You can set the cursor directly from css, with: "cursor: pointer", -no script needed.
 
But soon, you will need click select to deselect previous, soon after you will need dblclick
prevent text selection. Or later, how to multiple select. And at the end, what about keyboard
support, tab select etc? DIV elements can't receive focus. So, soon after you will find your self
wondering how about wrapping them divs in ancors tags so that files can receive tabbed focus?
And so on....
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                         Troy III                           progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060815/531ebc00/attachment.htm>


More information about the Javascript mailing list