Search Results

Search found 3 results on 1 pages for 'odavy'.

Page 1/1 | 1 

  • jQuery remove selected option from this

    - by odavy
    Hi all, first post here, I come in peace :) I've searched but can't quite find what I'm after. I am trying to manipulate the selected option of a select box. Can someone please explain why this works: $('#some_select_box').click(function() { $('#some_select_box option:selected').remove(); }); but this doesn't: $('#some_select_box').click(function() { $('this option:selected').remove(); }); I just want to use "this" instead of spelling out the id of the select box - can someone point me in the right direction for the correct syntax? It's driving me mad because it looks like it should be really simple. And I'm sure it is to someone, but not me, cos its the end of the day and I'm brain-fried... Any pointers much appreciated. Cheers

    Read the article

  • jquery 2 fades complete at the same time

    - by odavy
    Hello again, just another quick one: I am noticing differences with fadeOut dependant on whether this is a target. Here's my structure. I have rows of data on my page, and each row has two icons. One is an update icon for that row, one is a delete icon for that row. When a user clicks the update icon for a particular row, I want both the update and the delete icons to fade away. So, in order to fade the thing the user clicked (the update button) and its corresponding delete button, I am using... $(this).next().add(this).fadeOut('slow'); ...which works, but the two elements don't fade at the same time. this fades first (which is the update icon), and then this.next fades out (the delete icon). But if I specify the two elements by name... $('#updS2, #delS2').fadeOut('slow'); then they fade together. Why is it different? Apologies for Friday rambling.

    Read the article

  • jquery this and other elements

    - by odavy
    OK, going rond in circles again - I'm sure the answer will be obvious. Just not to me :) I can't seem to specify this as one target amongst a few targets for a function: $(this, "elem1, elem2").doStuff() I just want to doStuff() to a pair of elements, one of which is this. I can only get it to work if I explicitly name the elements, ie... $("elem1, elem2, elem3").doStuff() ...works fine. But I can't seem to get it to work if I want to include this in the list. I have to write one line just for this, and another for elem1 elem2 etc. All help greatly appreciated. Thanks.

    Read the article

1