[jQuery] Re: Change opacity for all divs except one

2009-12-05 Thread aaronjacobstew...@gmail.com
Although the description is somewhat unclear, if you wish to allow the
user to have several thumbnails selected, all at full opacity, you
should adapt Maurico's nice script a little; the .click function
should add the selected thumbnail to an array or list which can be
used in the chain to filter the siblings before fading them down, as
above.

On Dec 5, 2:10 am, "Mauricio \(Maujor\) Samy Silva"
 wrote:
> Hi Jared
> The script is quite simply.
> Study it.
>
> jQuery:
> (document).ready(function(){
>
>  $('#thumbs div').click(function() {
>     $(this).find('img').css('opacity', 1);
>     $(this).siblings().find('img').css('opacity', 0.5);
>  });
>
> });
>
> HTML:
> 
> 
> 
> 
> 
> 
> 
> 
>
> Hope this help you
>
> Maurício
>   -Mensagem Original-
>   De: Jared
>   Para: jQuery (English)
>   Enviada em: sexta-feira, 4 de dezembro de 2009 19:42
>   Assunto: [jQuery] Change opacity for all divs except one
>
>   Hello all,
>
>   I have a bunch of thumb nails that will be at full opacity when a user
>   gets to the page. Users will be able to select their favorite. What I
>   want to have happen is when a user selects their first favorite all of
>   the there thumbnails will be lowered in opacity then when they select
>   other favorites the opacity of that thumbnail will be brought to full.
>   Each thumbnail is in a div. I am at a complete lose on how I can
>   achieve this. Any help is greatly appreciated. If you need anymore
>   info just ask. Thanks ins advance!


[jQuery] Re: Content loaded via Ajax and global JS

2009-12-05 Thread aaronjacobstew...@gmail.com
Two ways.  One is to extend your ajax callback to un-bind all existing
button handlers and then re-bind them now that your new content has
been inserted.
OR the elegant way; use the .live method instead of .bind, it is
designed for just such occasions.

http://docs.jquery.com/Events/live#typefn

good luck

On Dec 4, 11:38 pm, mysterious79  wrote:
> This probably isn't a jquery question precisely, but jquery is being
> used as my method for making ajax requests.
>
> I'm running into a recurring problem where functions declared on the
> initial page load aren't manipulating content loaded later via ajax.
> For example, when the page loads I may have two ".button" elements but
> then I pull in three more via ajax. A function that affects
> that .button class will work on the original elements but not the ones
> added via ajax.
>
> Here is a very basic but functional example of this:
>
> --
> 
> $(function() {
>         $('p').click(function() {
>                 $.ajax({
>                         url : 'testing.html',
>                         type: 'get',
>                         success : function(data) {
>                                 $('.container').append(data);
>                         }
>                 });
>         });});
>
> 
>
> 
> Hello
> 
> --
>
> In this example, a click of any p tag should append the content from
> testing.html onto the doc. testing.html is a fragment that has a
> duplicate p tag. Well, I want every new p tag to have the same
> behavior as the original one. How do I do that? I've found that
> putting that writing that function into the fragment can solve the
> problem but this isn't the sort of solution I'm looking for.
> Sometimes, redeclaring the function in the success function will work
> as well, but this is inelegant as I'd like any function declared in
> the site js file to be available.
>
> What is a good method for getting around this sort of trouble?
>
> Thanks


[jQuery] Re: Change Window Location, and Send REQUEST or POST Info?

2009-12-20 Thread aaronjacobstew...@gmail.com
Absolutely, you can create a form with hidden fields on the page that
POSTS its values to the server, or you can initiate an AJAX request
with the current page and store it server side in the session, or you
can simply write the current pre-login page out to a cookie, and have
the login page redirect based on the cookie information after they log
in.

On Dec 19, 3:16 pm, Vik  wrote:
> Let's say a user visits my site, and takes an action that requires him
> to be logged in.  I would like to:
>
> - Take him to the login page
> - Automatically return to the page he started from after he logs in
>
> So I need to capture the current window.location, which is easy (var
> returnURL = window.location) and communicate it to my app.  I can't
> use URL variables (e.g. ?returnURL=http://www.returnlocation.com),
> because I'm using CodeIgniter, so I need to pass the returnURL in a
> POST or REQUEST variable.
>
> Is there a way to do this?
>
> Thanks in advance to all for any info.