Title: JavaScript Click not working
Last modified: December 2, 2019

---

# JavaScript Click not working

 *  Resolved [patrickpelsma](https://wordpress.org/support/users/patrickpelsma/)
 * (@patrickpelsma)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/javascript-click-not-working/)
 * Hello!
 * First of all, I would like to say that I really like the plugin! Keep up the 
   good work 😀
 * I ran into a challenge, and I hope you can help me out. I created custom buttons
   to navigate to different slides in my slider. For example, the button on the 
   second slide has the following code:
 *     ```
       <div class="app_yes">YES, I ALREADY HAVE THE APP, SO  BRING ME DIRECTLY TO STEP 3.</div>
       <script>
       N2R('#n2-ss-2', function($, slider){
           jQuery('.app_yes').click(function(){
               slider.slideToID(11);});
       });
       </script>
       ```
   
 * All buttons have a unique class name, and the JavaScript code is in the text 
   button from Smart Slider.
 * **Challenge:**
    Sometimes, you need more than one click to execute the action(
   let’s say to go the next page). You could see that this is not really userfriendly.
   Therefore, I hope you know a solution to fix this.
 * Thank you so much for your help.
 * Looking forward to hearing from you.
 * Best regards,
 * Patrick
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-click-not-working%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Laszlo](https://wordpress.org/support/users/laszloszalvak/)
 * (@laszloszalvak)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/javascript-click-not-working/#post-12198187)
 * Hi Patrick!
 * The problem seems to be related you have the class added only on the text, so
   it won’t trigger the JavaScript code when you click on the parts of the button
   that the text doesn’t cover.
 * So what you should do instead, is the following:
    - add the class for the Button Layer on its Settings tab, at the “CSS class”
      field: [https://smartslider3.helpscoutdocs.com/article/392-layer-window-settings#class](https://smartslider3.helpscoutdocs.com/article/392-layer-window-settings#class)
    - in the label of the Button Layer, you should enter just the text without HTML(
      since the CSS class should be added on the place I mentioned above )
    - you should add the JavaScript codes at Slider Settings > Developer tab > JavaScript
      Callbacks as you see here: [https://smartslider3.helpscoutdocs.com/article/1294-slider-settings-developer#javascript-callbacks](https://smartslider3.helpscoutdocs.com/article/1294-slider-settings-developer#javascript-callbacks)
 * And that will most likely fix the problem!
 * Best regards,
    Laszlo.
 *  Thread Starter [patrickpelsma](https://wordpress.org/support/users/patrickpelsma/)
 * (@patrickpelsma)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/javascript-click-not-working/#post-12198217)
 * Hi Laszlo,
 * Woow, what a fast reply! Thank you so much for your help. I just changed one 
   button and it seems to work perfectly.
 * Again, thanks for your help!
 * Have a great day!!
 * Patrick
    -  This reply was modified 6 years, 6 months ago by [patrickpelsma](https://wordpress.org/support/users/patrickpelsma/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘JavaScript Click not working’ is closed to new replies.

 * ![](https://ps.w.org/smart-slider-3/assets/icon.svg?rev=2307688)
 * [Smart Slider 3](https://wordpress.org/plugins/smart-slider-3/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-slider-3/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-slider-3/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-slider-3/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-slider-3/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-slider-3/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 2 replies
 * 2 participants
 * Last reply from: [patrickpelsma](https://wordpress.org/support/users/patrickpelsma/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/javascript-click-not-working/#post-12198217)
 * Status: resolved