#10917 closed enhancement (invalid)
clicks on LightBox image
Reported by: | hungerburg | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | General | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In order to ease viewing of a sequence of grouped images in a lightbox, I connect to the "onclick" handler of the lightbox image node like this: dojo.connect(lightbox.imgNode, "onclick",lightbox, "_nextImage");
In firefox and IE, this only works with the first image that is shown when the lightbox dialogue pops up. Clicks on the following images will do nothing, as the handler is no longer there, possibly because the image node was swapped and along with it the handler was scrapped. Yet it works in google-chrome - though I dont know why.
Maybe, if you see a use for my case, I suggest to wrap the image in the lightbox's template into another div or span attachPoint, so a handler connected to imgNode.onclick can survive in a browser independet fashion? (Connecting to the image's parent container will shadow clicks on the prev, next and close buttons, so that is not an option.)
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
this is already possible? Both Lightbox and LightboxDialog? have a public onClick registered to the wrapper node around the images, and it does bubble up but filters out the case where an icon was clicked. You can define the onClick handler in the construction of the Lightbox or connect to the instance
var n = new dojox.image.Lightbox({ onClick:.... }) // or dojo.connect(n, "onClick", function(img){ ... });
the { group:name, href:url } data is passed to the listener.
comment:3 Changed 12 years ago by
I see, its uppercas C in onClick - thank you dante! and thank you all the contributors for the dojo goodness :)
In the last paragraph above:
I wanted to say, a handler on /thatOtherNode/.onclick can survive the image swap.