javascript - Jquery don't focus in disqus div -
I use Disqus in my news site for comments, I I had created a script in jQuery to toggle this button, and I can hide the div by hiding, but when this show does not focus on Div, but this is the place Where button This is not useful because pressing a button should take the user to the section where the comment is, but no. script: I tried to use anchors, but it gives it, still focus comments thank you for your help. To change the element dynamically display: none I I want to show the user a click on the button and hide this div.
$ (document) .ready (function () {$ ('. Gn-icon-bubble'). Attr ("href", "# Foot "). Click (function () {$ ('. Disqus_thread') toggle ('swing');});});
.gn-icon-bubble is a button and as you know,
.disqus-thread is div class;
#foot My anchor is in the footer of the main page, but still does not work.
preventDefault
Event Delegation Use to stop default work >
$ (document) .ready (function () {$ ('. Gn-icon-bubble'). Attr ("href" , "# Foot"); $ (document) .on ("click", ".gn-icon-bubble [href = # foot]", function (event) {// event.preventDefault (); if you use default anchor Action wants to stop the tag $ ('. Disqus_thread') toggle ('swing');});});
Comments
Post a Comment