[jQuery] Re: Ajax uplaod
Turns out the problem was with 'var'. Changed 'clickedItem = this;' to 'var clickedItem = this;' solved my problem. I'm going to have to read up on var, it was my understanding that using var within a function made it local. Hmmm... ?? sinkingfish wrote: > > I'm doing some ajax image uploads using the plugin at valums.com (thanks). > > I have multiple images on the page which I will be replacing with the > uploaded image. My problem is this, trying to refer to the clicked image > within the onComplete function. > > I tried creating a variable that refered to 'this' which I beleive to be > the image element but when I make the change to the element it is not > refected, making me think that the variable is a copy and not a reference > ? > > I've pasted here for you to have a peak. > http://pastie.org/524221 > > Thanks > > Brian > -- View this message in context: http://www.nabble.com/Ajax-uplaod-tp24203971s27240p24206367.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Ajax uplaod
I'm doing some ajax image uploads using the plugin at valums.com (thanks). I have multiple images on the page which I will be replacing with the uploaded image. My problem is this, trying to refer to the clicked image within the onComplete function. I tried creating a variable that refered to 'this' which I beleive to be the image element but when I make the change to the element it is not refected, making me think that the variable is a copy and not a reference ? I've pasted here for you to have a peak. http://pastie.org/524221 Thanks Brian -- View this message in context: http://www.nabble.com/Ajax-uplaod-tp24203971s27240p24203971.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Interface sortable: Limit of elements which can be dragged into a droppable
I'm also looking for an elegant solution to this. Did you have any luck? I've implemented it with sortables, but don't have return animations. Is there a better way of achieving this? I've uploaded here for example http://www.sinkingfish.com/target.html http://pastie.org/514867 Thanks Brian Sebastian Giffhorn wrote: > > > Hi, > > Please have a look at my sample at > http://hosting-saar.de/jquerytest/index.html > > The situation is: > > I have 2 sortables, one is the "pool" which contains all available > icons the other should be an "ui" where you can place icons from the > "pool". > > The problem is: There are more icons in the "pool" than place for > icons in the ui. So is there a way to prevent icons to be dropped into > the ui when its already "full"? > > Regards, > > Sebastian > > > -- View this message in context: http://www.nabble.com/Interface-sortable%3A-Limit-of-elements-which-can-be-dragged-into-a-droppable-tp10336512s27240p24070473.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Special Entities returned in json via plugin Ajax upload ??
Hi I'm using the ajax upload plugin (http://valums.com/ajax-upload/) to upload images to the server. I'm then storing the images in an image cache and returning to the client 2 pieces of info in a json object, 1 the imageId & the url to display the image. The problem I'm having is that the plugin doesn't work properly with json responses, presumably because it's loading the response into an iframe. When I return a json object (using zend framework) it prompts to download the object. So a solution that was working for me was just to echo the response. The problem I'm having is that the ampersands in my url are getting replace with the html Special Entities equivalent - "&" which won't do. Does anyone know of a graceful way or reverting from special entities? I'm not a javascript guru :( Thanks Brian -- View this message in context: http://www.nabble.com/Special-Entities-returned-in-json-via-plugin-Ajax-uploadtp23443935s27240p23443935.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Getting all children, not just immediate children??
Hi I trying to write a script which allows for easily hiding and revealing content by just specifying the correct class names. The problem I'm having is that my current script will only toggle elements if the 'toggletarget' is a immediate sibling of the 'togglebutton'. My problem is that the 'togglebutton' may or may not be nested within div's, tables etc. Is their a way to find all the children of an element? Am I missing something? Ta $(function(){ $("div.togglecontainer span.togglebutton").click(function() { $(this).siblings("div.toggletarget").slideToggle(); //$(this).parent('div.togglecontainer').find('div.toggletarget').slideToggle(); }).css('cursor', 'pointer'); $('div.toggletarget').hide(); }); -- View this message in context: http://www.nabble.com/Getting-all-children%2C-not-just-immediate-children---tp22830245s27240p22830245.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Posting a serialized string without Ajax ??
Hi, I think i might be overlooking the obvious but I've got a string from my sortable list, something like : item[]=3&item[]=1... I don't want to post this using ajax, I want to do a plain old post, but how do I append the string to the post url? Thanks Brian -- View this message in context: http://www.nabble.com/Posting-a-serialized-string-without-Ajaxtp21834948s27240p21834948.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Nesting toddle div's
That's great, thanks Richard. Thanks for the explanation too, really helped to show me where i was going wrong. Brian Richard D. Worth-2 wrote: > > This should work: > > $("div.togglecontainer div.togglebutton").click(function() { > $(this).siblings("div.toggletarget").slideToggle(); > }); > $('div.toggletarget').hide(); > > A couple of notes: > > - I combined your first two selectors into one > - I've used .click(fn) in place of .bind("click", fn) > - No need for .each as .click will automatically do .each inside it > - I first changed your .parent().find("div.toggletarget") to > .parent().children("div.toggletarget") - this was your biggest issue > - I then substituted .siblings for .parent().children("div.toggletarget") > - No need to compare event.target, nor return false, since you are binding > to elements with no descendants > > - Richard > > On Fri, Nov 14, 2008 at 12:34 PM, sinkingfish <[EMAIL PROTECTED]> > wrote: > >> >> >> Thanks for the reply Richard, unfortunately that wasn't the issue. Ive >> tided >> up my example to make it clearer : http://pastie.org/314976 >> http://pastie.org/314976 >> >> So at startup you should see 'Click me' then upon clicking, 'I'm Hidden' >> & >> 'Click ME To see more' will be revealed. After clicking 'Click ME To see >> more', 'Nested Hidden' would be revealed. >> >> Thanks for the help >> >> >> >> Richard D. Worth-2 wrote: >> > >> > You may want to start by validating your html. You're missing a closing >> > , so it's not clear how you intend it to be nested. Once you've >> > corrected that, let us know if you still have a problem. >> > >> > - Richard >> > >> > On Fri, Nov 14, 2008 at 10:26 AM, sinkingfish <[EMAIL PROTECTED]> >> > wrote: >> > >> >> >> >> >> >> Hi, >> >> >> >> Im new to jQuery and looking for a bit of help. Im trying to have >> >> toggleable >> >> content within toggleable content. >> >> >> >> >> >> http://pastie.org/314861 Code >> >> >> >> >> >> It's just not working for me, when I click the first toggle all is >> >> revealed? >> >> Am I way off? Something to do with propagation? >> >> >> >> Thanks >> >> Brian >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Nesting-toddle-div%27s-tp20502521s27240p20502521.html >> >> Sent from the jQuery General Discussion mailing list archive at >> >> Nabble.com. >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Nesting-toggle-div%27s-tp20502521s27240p20505081.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Nesting-toggle-div%27s-tp20502521s27240p20523483.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Nesting toddle div's
Thanks for the reply Richard, unfortunately that wasn't the issue. Ive tided up my example to make it clearer : http://pastie.org/314976 http://pastie.org/314976 So at startup you should see 'Click me' then upon clicking, 'I'm Hidden' & 'Click ME To see more' will be revealed. After clicking 'Click ME To see more', 'Nested Hidden' would be revealed. Thanks for the help Richard D. Worth-2 wrote: > > You may want to start by validating your html. You're missing a closing > , so it's not clear how you intend it to be nested. Once you've > corrected that, let us know if you still have a problem. > > - Richard > > On Fri, Nov 14, 2008 at 10:26 AM, sinkingfish <[EMAIL PROTECTED]> > wrote: > >> >> >> Hi, >> >> Im new to jQuery and looking for a bit of help. Im trying to have >> toggleable >> content within toggleable content. >> >> >> http://pastie.org/314861 Code >> >> >> It's just not working for me, when I click the first toggle all is >> revealed? >> Am I way off? Something to do with propagation? >> >> Thanks >> Brian >> -- >> View this message in context: >> http://www.nabble.com/Nesting-toddle-div%27s-tp20502521s27240p20502521.html >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Nesting-toggle-div%27s-tp20502521s27240p20505081.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Nesting toddle div's
Hi, Im new to jQuery and looking for a bit of help. Im trying to have toggleable content within toggleable content. http://pastie.org/314861 Code It's just not working for me, when I click the first toggle all is revealed? Am I way off? Something to do with propagation? Thanks Brian -- View this message in context: http://www.nabble.com/Nesting-toddle-div%27s-tp20502521s27240p20502521.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] toggle show hide - help
Hi, Im working my way through the book 'jQuery in Action' and i'm a bit stumped with a block of code and how it works. The Code : $(function(){ $('li:has(ul)') .click(function(event){ if (this == event.target) { $(this).children().toggle(); $(this).css('list-style-image', ($(this).children().is(':hidden')) ? 'url(plus.gif)' : 'url(minus.gif)'); } return false; }) .css('cursor', 'pointer') .click(); $('li:not(:has(ul))').css({ cursor: 'default', 'list-style-image':'none' }); }); http://www.nabble.com/file/p20479875/collapsible.list.take.2-me.html collapsible.list.take.2-me.html What I can't get my head around is how the page is set up on load, the ul image is set dependent on the click state, if (this == event.target) {... so to me this code says, when clicked and if the clicked element is in the jQuery group, then change the image and toggle (display/hide) the children. But what I don't get is how the states / images are set on initial page load when nothing has been clicked. Thanks for any pointers Brian -- View this message in context: http://www.nabble.com/toggle-show-hide---help-tp20479875s27240p20479875.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.