javascript - How can I target a specific link/click in jQuery? -


http://jsfiddle.net/kevinorin/khhdt/

after clicking open 1 of black bars/accordions (example: "greenhouse gases") have link "more/less info" suppose toggle more information. problem click function not on "more/less info" element entire "."happening-main-text" element. clicking anywhere in div activates toggle , shouldn't be. ideas how modify jquery target .readmore in div?

    // more/less info why is happening jquery('.readmore').closest(".happening-main-text").click(function()                 {                       jquery(this).children(".divmore").toggle('slow');            return false;                                        }); 

use

jquery('.readmore').click(function() {                       jquery(this).closest(".happening-main-text").children(".divmore").toggle('slow');            return false;                                        }); 

what did precisely binding event enclosing ".happening-main-text" element.

demonstration


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -