[Javascript] Code optimization

Terry Riegel riegel at clearimageonline.com
Mon Aug 14 17:56:41 CDT 2006


I am not sure. How are you proposing the HTML look?

currently it is.

<div id="filelist">
   <div class="NOR PUB DIR" id="images"></div>
   <div class="NOR PUB TXT" id="bugs.txt"></div>
   <div class="SEL PRI PDF" id="bugs.pdf"></div>
   <div class="NOR PUB MOV" id="bugs.mov"></div>
</div>

I am using the class selector as input to the click events, I  
basically want to have two onclick events with the class information  
the same for both. This list could get very long as it represents the  
files in a directory, and I would like to keep the markup as succinct  
as possible.

If I keep the markup as is is there a way to create an onclick event  
for the image and another onclick event for the text?



On Aug 14, 2006, at 6:33 PM, John Warner wrote:

> Have you considered putting the text and images in separate tags of
> classes? As to the mouse icon change, check your CSS settings to  
> handle
> the mouse.
>
> John Warner
>
>
>> -----Original Message-----
>> From: javascript-bounces at LaTech.edu
>> [mailto:javascript-bounces at LaTech.edu] On Behalf Of Terry Riegel
>> Sent: Monday, August 14, 2006 5:53 PM
>> To: [JavaScript List]
>> Subject: Re: [Javascript] Code optimization
>>
>>
>> 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
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list