Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery slideToggle breaking when you press a link inside a div
    text
    copied!<p>I have having a little trouble with the slideToggle when I have a link inside of the slideup panel. What I am trying to do is have the ability to press a button and a div will slide up and display related posts and once you press another or the related project button on the page it will close the toggle and reveal another effect that I am using (100% width and heigh popup). The script I am using works perfect but I am running into one problem. When I click a related post inside of the slideToggle it causes the div to slide down instead of going to the page that represents the link.</p> <p>Here is my code below and an example <a href="http://jsfiddle.net/K8vBg/15/" rel="nofollow">http://jsfiddle.net/K8vBg/15/</a>.</p> <pre><code>$(document).ready(function(){ // build a variable to target the #menu div var menu = $('#menu') // bind a click function to the menu-trigger $('#menu-trigger').click(function(event){ event.preventDefault(); event.stopPropagation(); // if the menu is visible slide it up if (menu.is(":visible")) { menu.slideUp(1000); } // otherwise, slide the menu down else { menu.slideDown(400); } }); $(document).not('.projectHolder-small,#projectSpecs').click(function(event) { event.preventDefault(); if (menu.is(":visible")) { menu.slideUp(400); } }); }) </code></pre> <p>If I change .projectHolder-small,#projectSpecs in the .not function to just read #menu then I am able to click the link inside of the panel but the panel will not slideDown when I click another button on the page. The popup from #project specs will just go over the panel instead of closing it.</p> <p>Is there something I am missing in my script?</p> <p>Thank you </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload