jquery Prevent to call function

<div class="content">
    <div style="background:url(...jpg) no-repeat #01AEF0;" class="slide-small">
       <div><strong>Title</strong></div>
        <div class="read_more"><a class="t_10" href="http://example.com/">Read More</a></div>
     </div> 
</div>

When I click on the div that has a class="content" my code calls function. When I click on Read More the function is called and after that the new page opens. I need not to call the function, only open the href.

Answers


$('.read_more a').click(function(e){
   e.stopPropagation();
});

events like click bubble to ancestor elements. To prevent that event bubble further than your a element ... read this: http://api.jquery.com/event.stopPropagation/


Need Your Help

Replacing space in text from a web-page

vb.net string replace

I have two lines of text which have long space (more like 14-15 spaces) before the actual text. I have tried simple replace to split and merge but nothing is working. I have also tried trim and the...

How to play a sound in Actionscript 3 that is not in the same directory as the SWF?

flash url actionscript audio urlrequest

I have a project with a bunch of external sounds to a SWF. I want to play them, but any time I attempt load a new URL into the sound object it fails with either "Error #2068: Invalid Sound" or rai...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.