Hi. First time posting here. I am trying to replicate holding shift + click to select multiple links. I have the shift/click working but have no clue how to go about say, clicking on the 1st link, then holding the shift key, eventually clicking the 5th link, would add a class to highlight links from 1-5.
Here is what I have: var shiftPressed = event.shiftKey; if ((shiftPressed || $(this)) == true) { /* I assume this is where the action to add the class for particular links would go */ } Hope you guys understood. Thanks in advance. On Aug 3, 5:15 pm, MeltingIce <[EMAIL PROTECTED]> wrote: > Good idea, that seemed to do the trick. Thanks! > > On Aug 3, 3:57 pm, Tobia Conforto <[EMAIL PROTECTED]> wrote: > > > MeltingIce wrote: > > > I'm working on a script thats somewhat similar to a directory > > > listing script and I'm trying to emulate the ability to select > > > multiple files at once by holding down theshiftkey > > > Just an idea: I believe I read somewhere that the event object for a > > mouseclickcontains the information on the modifier keys that were > > pressed when theclickoccurred: > > > $('.file').click(function(event) { > > if (event.SOMETHING) > > //shift-click > > else > > //normalclick > > > }); > > > I don't know the details, though. > > > Tobia