Saturday, 15 January 2011

javascript - jQuery Click Event: Need two clicks -



javascript - jQuery Click Event: Need two clicks -

i have grid of elements , on click on every element, element append tittle in div outside grid (it's simplified version of mi script).

the problem is, when click on element, runs good, title append in special div, when click on b element, special div don't show b title , when click twice, special div shows b title.

i search alot of issues, double click on events, homecoming false or event.stoppropagation, doesen't work , seek understand why, don't know event "assigned" element.

i'm working jquery.click looks like:

$('.grid div').click( function(e) { e.preventdefault(); $('h2').empty(); var nombre = $(this).find('.nombre').text(); $('h2').append(nombre); $('.info').toggleclass('undisplayed'); $(this).toggleclass('active'); });

every help should nice :d

pd. sorry mi english

i think doing right changes following:

$('.grid div').click( function(e) { var nombre = $(this).find('.nombre').text(); $('h2').text(nombre); $('.info').toggleclass('undisplayed'); $(this).toggleclass('active'); });

javascript jquery html

No comments:

Post a Comment