Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #30884
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: getElementsByClassName only inserts first image into canvas after ruby each loop |
| Date | Sun, 17 Jul 2016 14:23:27 +0100 |
| Organization | A noiseless patient Spider |
| Lines | 22 |
| Message-ID | <87oa5wjt4g.fsf@bsb.me.uk> (permalink) |
| References | <3397987e-7925-4c49-8a94-d5f12a152223@googlegroups.com> <87lh192ff0.fsf@bsb.me.uk> <267f7082-d654-4a09-81d6-78f90e2a1fe6@googlegroups.com> <8760s5n5b3.fsf@bsb.me.uk> <9b00f7f2-3e67-4a1a-bc96-8027c3972c3c@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Info | mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="4184"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NAu3zyVD4FwdYMRzJRfRxbQtYuUCcsu8=" |
| Cancel-Lock | sha1:NVde9TVgrl1TuI9Z3nakcDYdyzQ= sha1:PeT7aYbgGdtzNU0QLMZ77BwQiag= |
| X-BSB-Auth | 1.1f309f08671435646edb.20160717142327BST.87oa5wjt4g.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:30884 |
Show key headers only | View raw
patrick lowry <plowry05@gmail.com> writes:
<snip>
>
> Thanks Ben for the reply. I am using Jquery. Apologize i just don't
> follow and still can't seem to get it. If i put a [4] at the end of
> imgElement I can get the 4th image from the iteration to the canvas
> which obviously make sense. But Im not sure how to add your approach
> to what I have written. Any ideas?
>
> var canvas = new fabric.Canvas('canvas');
> $(".my-image").on('click',function() {
> var imgElement = document.getElementsByClassName("my-image")[4]
If you want imgElement to be the element on which the event was raised
you could try
$(".my-image").on('click',function(evt) {
var imgElement = evt.target;
<snip>
--
Ben.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
getElementsByClassName only inserts first image into canvas after ruby each loop plowry05@gmail.com - 2016-07-09 21:07 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop JJ <jj4public@vfemail.net> - 2016-07-10 20:16 +0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop howtovideos3421@gmail.com - 2016-07-10 08:40 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop patrick lowry <plowry05@gmail.com> - 2016-07-10 08:44 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-11 01:21 +0100
Re: getElementsByClassName only inserts first image into canvas after ruby each loop patrick lowry <plowry05@gmail.com> - 2016-07-15 20:59 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-07-16 09:21 +0200
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-16 13:19 +0100
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Osmo Saarikumpu <osmo@weppipakki.com> - 2016-07-17 07:32 +0300
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-17 13:42 +0100
Re: getElementsByClassName only inserts first image into canvas after ruby each loop "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-17 15:06 +0200
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-17 14:20 +0100
Re: getElementsByClassName only inserts first image into canvas after ruby each loop "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-07-17 16:02 +0200
Re: getElementsByClassName only inserts first image into canvas after ruby each loop patrick lowry <plowry05@gmail.com> - 2016-07-17 05:56 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop patrick lowry <plowry05@gmail.com> - 2016-07-17 05:51 -0700
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-07-17 14:23 +0100
Re: getElementsByClassName only inserts first image into canvas after ruby each loop Martin Honnen <martin.honnen@gmx.de> - 2016-07-17 15:34 +0200
Re: getElementsByClassName only inserts first image into canvas after ruby each loop patrick lowry <plowry05@gmail.com> - 2016-07-17 18:03 -0700
csiph-web