Monday, 15 August 2011

jquery - How to exclude a particular <div> from javascript -


I'm a begineer and I'm having trouble solving the problem. I have a website I have used javascript to scroll effect below:

  jQuery (function ($) {$ ('a [href * = #]: no ([ Href = #]). '(Function () {If (location.pathname.replace (/ ^ \ //,' ') == this.pathname.replace (/ ^ \ //,' ') and ; Location.hostname == this.hostname) {var Target = $ (This.hash); target = target.length? Target: $ ('[name =' + this.hash.slice (1) + ']') ; If (target.length) {$ ('html, atom ({scrollTop: (target.offset (top-80)}, 1000); return return;}}}) $ ('. Nav a ') ('Click', function) {$ (". Navbar-toggle"). Click ()});});  

The problem is that This content is conflicting under the "Testimonials" section.The text to be clicked on the image (internal link) is not showing the text associated with it, on the other hand, it is giving scrolling effect

testimonials Section code can be found here:

How to fix it?

PS: I hope the details of my problem are clear: /

< P>

I suggest that your javascript In global rather than specifically to help "implement behavior".

Instead of dealing with all the links on your page

  $ ('a [href * = #]: no ([href = #])') Try typing it to an anchor tag with a normal class (in this example,  nav-link ), and each link in your nav bar Assign that category to 

  $ ('a.nav-link [href * =]: no ([href = #])')  
< P> or at least only your .nav anchor tag

  $ ('. Nav a [href * = #]: no ([href = #]) ')  

this Also, all the other links on your page can behave normally when "hijacked" the behavior of your nav links.


No comments:

Post a Comment